You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2022/07/08 03:40:29 UTC

[GitHub] [incubator-pegasus] acelyc111 commented on a diff in pull request #1035: fix(update_replication_factor#12): update the mutation_2pc_min_replica_count base the max count of table

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


##########
rdsn/src/replica/replica.h:
##########
@@ -497,6 +497,8 @@ class replica : public serverlet<replica>, public ref_counter, public replica_ba
 
     void update_app_max_replica_count(int32_t max_replica_count);
 
+    int32_t mutation_2pc_min_replica_count();

Review Comment:
   ```suggestion
       int32_t mutation_2pc_min_replica_count() const;
   ```



##########
rdsn/src/common/replication_common.h:
##########
@@ -117,6 +117,11 @@ class replication_options
     ~replication_options();
 
     void initialize();
+
+    int32_t min_2pc_replica_count(int32_t app_max_replica_count)
+    {
+        return std::min(mutation_2pc_min_replica_count, app_max_replica_count) - 1;

Review Comment:
   Should be `return std::min(mutation_2pc_min_replica_count, app_max_replica_count - 1);` ?



##########
rdsn/src/common/replication_common.h:
##########
@@ -117,6 +117,11 @@ class replication_options
     ~replication_options();
 
     void initialize();
+
+    int32_t min_2pc_replica_count(int32_t app_max_replica_count)
+    {
+        return std::min(mutation_2pc_min_replica_count, app_max_replica_count) - 1;

Review Comment:
   Should be `return std::min(mutation_2pc_min_replica_count, app_max_replica_count - 1);` ?



##########
rdsn/src/common/replication_common.h:
##########
@@ -117,6 +117,11 @@ class replication_options
     ~replication_options();
 
     void initialize();
+
+    int32_t min_2pc_replica_count(int32_t app_max_replica_count)

Review Comment:
   ```suggestion
       int32_t min_2pc_replica_count(int32_t app_max_replica_count) const
   ```



##########
rdsn/src/meta/meta_service.h:
##########
@@ -174,6 +174,8 @@ class meta_service : public serverlet<meta_service>
         return metas.substr(0, metas.length() - 1);
     }
 
+    int32_t mutation_2pc_min_replica_count(int32_t app_max_replica_count);

Review Comment:
   ```suggestion
       int32_t mutation_2pc_min_replica_count(int32_t app_max_replica_count) const;
   ```



##########
rdsn/src/common/replication_common.h:
##########
@@ -117,6 +117,11 @@ class replication_options
     ~replication_options();
 
     void initialize();
+
+    int32_t min_2pc_replica_count(int32_t app_max_replica_count)
+    {
+        return std::min(mutation_2pc_min_replica_count, app_max_replica_count) - 1;

Review Comment:
   Should be `return std::min(mutation_2pc_min_replica_count, app_max_replica_count - 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: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org