errose28 commented on code in PR #3534:
URL: https://github.com/apache/ozone/pull/3534#discussion_r918412092


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/upgrade/BasicUpgradeFinalizer.java:
##########
@@ -85,14 +87,20 @@ public StatusAndMessages finalize(String upgradeClientID, T 
service)
     StatusAndMessages response = initFinalize(upgradeClientID, service);
     if (finalizationLock.tryLock()) {
       try {
-        // Even if the status indicates finalization completed, the component
-        // may not have finished all its specific steps if finalization was
-        // interrupted, so we should re-invoke them here.
+        // If we were able to enter the lock and finalization status is "in
+        // progress", we should resume finalization because the last attempt
+        // was interrupted. If an attempt was currently ongoing, the lock
+        // would have been held.
         if (response.status() == FINALIZATION_REQUIRED ||
-            !componentFinishedFinalizationSteps(service)) {
+            response.status() == FINALIZATION_IN_PROGRESS) {
           finalizationExecutor.execute(service, this);
           response = STARTING_MSG;
         }
+        // Else, the initial response we got from initFinalize was still
+        // correct.
+      } catch (NotLeaderException e) {
+        LOG.info("Leader change encountered during finalization. This " +
+            "component will continue to finalize as a follower.", e);

Review Comment:
   This component was the leader and driving finalization. If an NLE is thrown, 
then this component is no longer the leader. It will stop sending Ratis 
requests to drive finalization and instead finalize based on Ratis transactions 
it receives from the leader. I will amend the log message to try to clarify 
this.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to