Elia-Renzoni commented on code in PR #1586:
URL: https://github.com/apache/ratis/pull/1586#discussion_r4156026415
##########
ratis-server-api/src/main/java/org/apache/ratis/server/RaftServerConfigKeys.java:
##########
@@ -1031,6 +1031,21 @@ static boolean memberMajorityAdd(RaftProperties
properties) {
static void setMemberMajorityAdd(RaftProperties properties, boolean
enableMemberMajorityAdd) {
setBoolean(properties::setBoolean, MEMBER_MAJORITY_ADD_KEY,
enableMemberMajorityAdd);
}
+
+ String TRANSFER_LEADERSHIP_REQUIRED_APPLIED_INDEX_GAP_KEY =
".transfer-leadership.required-applied-index-gap";
+ long TRANSFER_LEADERSHIP_REQUIRED_APPLIED_INDEX_GAP_DEFAULT = 2_000L;
+ static long transferLeadershipRequiredAppliedIndexGap(RaftProperties
properties) {
+ return getLong(
+ properties::getLong,
+ TRANSFER_LEADERSHIP_REQUIRED_APPLIED_INDEX_GAP_KEY,
+ TRANSFER_LEADERSHIP_REQUIRED_APPLIED_INDEX_GAP_DEFAULT,
+ getDefaultLog(),
+ requireMin(0L)
+ );
+ }
+ static void setTransferLeadershipRequiredAppliedIndexGap(RaftProperties
properties, long appliedIndexValue) {
+ setLong(properties::setLong,
TRANSFER_LEADERSHIP_REQUIRED_APPLIED_INDEX_GAP_KEY, appliedIndexValue);
+ }
Review Comment:
Addressed here: 110c11ab35d96ecdd87c967e0fac998b14aa9925
##########
ratis-server/src/main/java/org/apache/ratis/server/impl/TransferLeadership.java:
##########
@@ -79,12 +79,14 @@ enum Type {
TIMED_OUT,
FAILED_TO_START,
COMPLETED_EXCEPTIONALLY,
+ RISKY_LEADER_CHANGE,
Review Comment:
Fixed here: 110c11ab35d96ecdd87c967e0fac998b14aa9925
--
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]