dombizita commented on code in PR #11800:
URL: https://github.com/apache/ozone/pull/11800#discussion_r4411705316
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/ozone/upgrade/RatisBasedVersionManager.java:
##########
@@ -58,6 +58,19 @@ public void finalizeFromSnapshotIfRequired(Table<String,
String> finalizationSto
}
}
+ /**
+ * Finalizes up to the apparent version recorded in the DB if the VERSION
file is behind it, for example because the
+ * process stopped during a snapshot install after the DB was replaced and
before the VERSION file was updated.
+ */
+ public void finalizeToDBVersionIfRequired(Table<String, String>
finalizationStore) throws IOException {
+ ComponentVersion apparentVersionInDB =
getApparentVersionInDB(finalizationStore);
+ if (apparentVersionInDB != null && !isAllowed(apparentVersionInDB)) {
+ LOG.warn("Version file has lower apparent version ({}) than DB ({}).
Finalizing to the DB version.",
+ getApparentVersion(), apparentVersionInDB);
+ finalizeUpgrade(apparentVersionInDB);
+ }
+ }
+
Review Comment:
`finalizeFromSnapshotIfRequired` and `finalizeToDBVersionIfRequired` are
pretty similar methods, but there is a difference between them, updating the
apparent version in the DB and how far they finalize to. This means that on
restart it stops at the DB version and on snapshot install it goes all the way
to its own software version and then rewrites the DB. Could this different
behaviour harm the finalization flow?
--
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]