GlenGeng commented on a change in pull request #1314:
URL: https://github.com/apache/hadoop-ozone/pull/1314#discussion_r486281665
##
File path:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/StateContext.java
##
@@ -478,7 +551,26 @@ public void execute(ExecutorService service, long time,
TimeUnit unit)
public SCMCommand getNextCommand() {
lock.lock();
try {
- return commandQueue.poll();
+ initTermOfLeaderSCM();
+ if (!termOfLeaderSCM.isPresent()) {
+return null; // not ready yet
+ }
+
+ while (true) {
+SCMCommand command = commandQueue.poll();
+if (command == null) {
+ return null;
+}
+
+updateTermOfLeaderSCM(command);
+if (command.getTerm() == termOfLeaderSCM.get()) {
Review comment:
Do you mean whether `termOfLeaderSCM` is updated in leader election of
SCM ? No, it won't. Datanode detects the latest SCM term by heartbeat with
SCMs, whose interval is larger than 30s.
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:
us...@infra.apache.org
-
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org