empiredan commented on code in PR #1035:
URL: https://github.com/apache/incubator-pegasus/pull/1035#discussion_r917583547


##########
rdsn/src/meta/meta_service.cpp:
##########
@@ -1306,5 +1306,15 @@ void 
meta_service::on_set_max_replica_count(configuration_set_max_replica_count_
                      server_state::sStateHash);
 }
 
+int32_t meta_service::mutation_2pc_min_replica_count(int32_t 
app_max_replica_count) const
+{
+    dassert_f(_app_info.max_replica_count > 0);
+if (_opts.mutation_2pc_min_replica_count > 0) {//  >0 means use the user config
+    return _opts.mutation_2pc_min_replica_count;
+} else {// otherwise based on the table max_replica_count
+    return app_max_replica_count <=2 ? 1 :  app_max_replica_count / 2 + 1;
+}

Review Comment:
   ```suggestion
       if (_opts.mutation_2pc_min_replica_count > 0) { //  > 0 means use the 
user config
           return _opts.mutation_2pc_min_replica_count;
       } else { // otherwise based on the table max_replica_count
           return app_max_replica_count <= 2 ? 1 :  app_max_replica_count / 2 + 
1;
       }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to