sumitagrawl commented on code in PR #7554:
URL: https://github.com/apache/ozone/pull/7554#discussion_r1878135739


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconSchemaManager.java:
##########
@@ -45,13 +49,46 @@ public ReconSchemaManager(Set<ReconSchemaDefinition> 
reconSchemaDefinitions) {
 
   @VisibleForTesting
   public void createReconSchema() {
-    reconSchemaDefinitions.forEach(reconSchemaDefinition -> {
-      try {
-        reconSchemaDefinition.initializeSchema();
-      } catch (SQLException e) {
-        LOG.error("Error creating Recon schema {}.",
-            reconSchemaDefinition.getClass().getSimpleName(), e);
-      }
-    });
+    // Calculate the latest SLV from ReconLayoutFeature
+    int latestSLV = calculateLatestSLV();
+
+    try {
+      // Initialize the schema version table first
+      reconSchemaDefinitions.stream()

Review Comment:
   During startup, if no version is defined, -1 refer same as NO_VERSION. "0" 
version is INITIAL_VERSION which will be first upgrade. So both first startup 
and upgrade case, version should be -1, and this will trigger first action of 
update the constraint.
   
   Unable to identify case it try to solve.



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