sodonnel commented on code in PR #11925:
URL: https://github.com/apache/ozone/pull/11925#discussion_r4515331813


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/upgrade/FinalizationStateManagerImpl.java:
##########
@@ -52,6 +53,36 @@ public void finalizeUpgrade() throws IOException {
         OzoneConsts.APPARENT_VERSION_KEY, 
String.valueOf(versionManager.getApparentVersion().serialize()));
   }
 
+  @Deprecated
+  @Override
+  public void addFinalizingMark() {
+    // The pre-ZDU finalizing mark is no longer used, see 
ClearFinalizingStateScmUpgradeAction.
+  }
+
+  /**
+   * Finalizes up to the given pre-ZDU layout version, but not beyond it, as 
the SCM that wrote the entry did.
+   */
+  @Deprecated
+  @Override
+  public void finalizeLayoutFeature(Integer layoutVersion) throws IOException {
+    if (layoutVersion == null) {
+      throw new IOException("finalizeLayoutFeature requires a layout version 
argument");
+    }
+    HDDSLayoutFeature feature = HDDSLayoutFeature.deserialize(layoutVersion);
+    if (feature == null) {
+      throw new IOException("Unknown pre-ZDU layout version " + layoutVersion);
+    }
+    versionManager.finalizeUpgrade(feature);
+    transactionBuffer.addToBuffer(finalizationStore,
+        OzoneConsts.APPARENT_VERSION_KEY, 
String.valueOf(versionManager.getApparentVersion().serialize()));

Review Comment:
   The method finalizeFromSnapshotIfRequired() does not exist anywhere in the 
codebase anymore. The actual method is finalizeFromDBIfRequired() in 
RatisBasedVersionManager, which is called by 
FinalizationStateManagerImpl.reinitialize() on snapshot install.
   
   Looking at finalizeFromDBIfRequired:
   
   finalizeUpgrade(apparentVersionInDB);  // already the overloaded version
   
   It already calls finalizeUpgrade(ComponentVersion), not the no-arg version. 
The suggested fix — "call finalizeUpgrade(apparentVersionInNewDB)" — is already 
what happens.



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