empiredan commented on code in PR #1035:
URL: https://github.com/apache/incubator-pegasus/pull/1035#discussion_r917589290
##########
rdsn/src/replica/replica.cpp:
##########
@@ -581,5 +581,15 @@ error_code replica::store_app_info(app_info &info, const
std::string &path)
return err;
}
+int32_t replica::mutation_2pc_min_replica_count() const
+{
+ dassert_f(_app_info.max_replica_count > 0);
+if (_options->mutation_2pc_min_replica_count > 0) {// >0 means use the user
config
+ return _options->mutation_2pc_min_replica_count;
+} else {// otherwise based on the table max_replica_count
+ return _app_info.max_replica_count <=2 ? 1 : _app_info.max_replica_count
/ 2 + 1;
+}
Review Comment:
```suggestion
if (_options->mutation_2pc_min_replica_count > 0) { // > 0 means use the
user config
return _options->mutation_2pc_min_replica_count;
} else { // otherwise based on the table max_replica_count
return _app_info.max_replica_count <= 2 ? 1 :
_app_info.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]