GlenGeng commented on a change in pull request #2028:
URL: https://github.com/apache/ozone/pull/2028#discussion_r592308321
##########
File path:
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMHAConfiguration.java
##########
@@ -156,6 +156,22 @@
)
private long ratisLeaderElectionTimeout = 5 * 1000L;
+ @Config(key = "ratis.leader.ready.wait.timeout",
+ type = ConfigType.TIME,
+ defaultValue = "60s",
Review comment:
indent. just 4 spaces.
##########
File path:
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMHAConfiguration.java
##########
@@ -280,6 +296,10 @@ public long getLeaderElectionMaxTimeout() {
return ratisLeaderElectionTimeout + 200L;
}
+ public long getLeaderReadyWaitTimeout() { return
ratisLeaderReadyWaitTimeout;}
Review comment:
```
public long getLeaderReadyWaitTimeout() {
return ratisLeaderReadyWaitTimeout;
}
```
Better has setter too.
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisServerImpl.java
##########
@@ -94,8 +94,10 @@ public static void initialize(String clusterId, String scmId,
try {
server = newRaftServer(scmId, conf).setGroup(group).build();
server.start();
- // TODO: Timeout and sleep interval should be made configurable
- waitForLeaderToBeReady(server, 60000, group);
+ final SCMHAConfiguration haConf =
conf.getObject(SCMHAConfiguration.class);
+ long waitTimeout = haConf.getLeaderReadyWaitTimeout();
+ long retryInterval = haConf.getLeaderReadyCheckInterval();
+ waitForLeaderToBeReady(server, waitTimeout, retryInterval, group);
Review comment:
How about just pass `conf` to `waitForLeaderToBeReady`, and read out
`retryInterval` and `waitTimeout` there ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]