szetszwo commented on code in PR #897:
URL: https://github.com/apache/ratis/pull/897#discussion_r1282390481
##########
ratis-server-api/src/main/java/org/apache/ratis/server/DivisionProperties.java:
##########
@@ -47,6 +47,14 @@ default int maxRpcTimeoutMs() {
return maxRpcTimeout().toIntExact(TimeUnit.MILLISECONDS);
}
+ /** @return the bound of leader lease timeout */
+ TimeDuration leaderLeaseTimeout();
+
+ /** @return the bound of leader lease timeout in milliseconds */
+ default int leaderLeaseTimeoutMs() {
+ return leaderLeaseTimeout().toIntExact(TimeUnit.MILLISECONDS);
+ }
Review Comment:
This should be internal use only. Let's not add it `ratis-server-api`?
##########
ratis-server-api/src/main/java/org/apache/ratis/server/RaftServerConfigKeys.java:
##########
@@ -770,6 +770,18 @@ static TimeDuration slownessTimeout(RaftProperties
properties) {
static void setSlownessTimeout(RaftProperties properties, TimeDuration
expiryTime) {
setTimeDuration(properties::setTimeDuration, SLOWNESS_TIMEOUT_KEY,
expiryTime);
}
+
+ String LEADER_LEASE_TIMEOUT_BOUND_RATIO_KEY = PREFIX +
".leader.lease.timeout-bound.ratio";
+ int LEADER_LEASE_TIMEOUT_BOUND_RATIO_DEFAULT = 90;
Review Comment:
- Since this is Read related, let's move it to `RaftServerConfigKeys.Read`.
- How about calling it `PREFIX + ".leader.lease.timeout.ratio"`?
- Let's use `double` (0 < x <= 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]