amaliujia commented on a change in pull request #1725:
URL: https://github.com/apache/ozone/pull/1725#discussion_r557147410



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMStateMachine.java
##########
@@ -55,15 +84,25 @@ public void registerHandler(RequestType type, Object 
handler) {
     try {
       final SCMRatisRequest request = SCMRatisRequest.decode(
           Message.valueOf(trx.getStateMachineLogEntry().getLogData()));
-      applyTransactionFuture.complete(process(request));
+      applyTransactionFuture.complete(
+          process(
+              request,
+              SCMTransactionInfo.builder()
+                  .setCurrentTerm(trx.getLogEntry().getTerm())
+                  .setTransactionIndex(trx.getLogEntry().getIndex())
+                  .build()));
     } catch (Exception ex) {
       applyTransactionFuture.completeExceptionally(ex);
     }
     return applyTransactionFuture;
   }
 
-  private Message process(final SCMRatisRequest request)
-      throws Exception {
+  private boolean shouldUpdate(SCMTransactionInfo info) {
+    return !(info.getTransactionIndex() == -1 && info.getTerm() == 0);

Review comment:
       Makes sense




----------------------------------------------------------------
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]

Reply via email to