rich7420 commented on code in PR #11650:
URL: https://github.com/apache/ozone/pull/11650#discussion_r4559682440


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconServer.java:
##########
@@ -167,7 +171,15 @@ public Void call() throws Exception {
           injector.getInstance(ReconSchemaManager.class);
 
       LOG.info("Creating Recon Schema.");
-      reconSchemaManager.createReconSchema();
+      // A new SQL DB on an existing Recon (for example after the move from 
Derby to SQLite) cannot tell which upgrade
+      // actions the derived data already has, so start from the initial 
version to run all of them.
+      ReconVersion newSqlDbVersion = existingInstall ? 
ReconVersion.INITIAL_VERSION : ReconVersion.SOFTWARE_VERSION;
+      reconSchemaManager.createReconSchema(newSqlDbVersion);

Review Comment:
   Tried it and yes, the restart skips the rebuild. But NSSummary lives in 
RocksDB, so it survives the SQL DB swap, and the only stale value is the 
GLOBAL_STATS containerCount, which nothing reads. Master has the same gap (an 
upgrade from v3 that restarts before the first sync never rebuilds NSSummary), 
so maybe a follow-up instead of doing it in this PR?
   



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