imzhenyu / rDSN

Robust Distributed System Nucleus (rDSN) is an open framework for quickly building and managing high performance and robust distributed systems.
MIT License
32 stars 12 forks source link

make mutation_2pc_min_replica_count depending on replica_count of table #252

Open qinzuoyan opened 8 years ago

qinzuoyan commented 8 years ago

Problem

Now the _mutation_2pc_min_replica_count_ is set in config file, and all replicas use the same one, then the problem is: if there are different replicas of different tables which have different _replica_count_, then use the same _mutation_2pc_min_replica_count_ is improper anymore.

Resolution

We can calculate the _mutation_2pc_min_replica_count_ from _partition_configuration.max_replica_count_ to ensure majority, for example:

mutation_2pc_min_replica_count = partition_configuration.max_replica_count / 2 + 1
imzhenyu commented 8 years ago

confused ... I thought you were talking about different apps may have different requirements of reliability (i.e., replica count). In this case, we can put this into the app specific configuration on meta server, which is further broadcasted to the replica servers.

imzhenyu commented 8 years ago

As for majority, our protocol does not really require majority at all as long as we think reliability is enough (e.g., we can have 2 replicas out of 5 being alive in our secondary set).