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


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconControllerModule.java:
##########
@@ -237,6 +237,12 @@ DataSourceConfiguration getDataSourceConfiguration(
     ReconSqlDbConfig sqlDbConfig =
         ozoneConfiguration.getObject(ReconSqlDbConfig.class);
 
+    if (StringUtils.startsWith(sqlDbConfig.getJdbcUrl(), "jdbc:derby:")) {
+      LOG.warn("Derby is no longer supported for the Recon SQL DB. Ignoring 
the configured {} and using the SQLite "

Review Comment:
   nit: Could we add `@Singleton` to `getDataSourceConfiguration`? I see this 
warning three times per startup without it.



##########
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:
   +1 to a follow-up.
   
   I tried a real 2.2.1 upgrade and noticed four ERROR lines at startup, 
because the rebuild can't be queued before the first sync. I wonder if the 
follow-up could keep the Recon version and a pending-rebuild marker in the 
VERSION file, which might fix both issues.



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