ctubbsii commented on code in PR #3160:
URL: https://github.com/apache/accumulo/pull/3160#discussion_r1099062325


##########
server/manager/src/main/java/org/apache/accumulo/manager/upgrade/UpgradeCoordinator.java:
##########
@@ -142,11 +145,17 @@ public synchronized void upgradeZookeeper(ServerContext 
context,
         "Not currently in a suitable state to do zookeeper upgrade %s", 
status);
 
     try {
-      int cv = context.getServerDirs()
-          .getAccumuloPersistentVersion(context.getVolumeManager().getFirst());
-      ServerContext.ensureDataVersionCompatible(cv);
+      int cv = AccumuloDataVersion.getCurrentVersion(context);
       this.currentVersion = cv;
 
+      int oldestVersion = upgraders.entrySet().iterator().next().getKey();
+      if (cv < oldestVersion) {
+        String oldRelease = dataVersionToReleaseName(oldestVersion);
+        throw new UnsupportedOperationException("Upgrading from a version less 
than " + oldRelease
+            + " data version (" + oldestVersion + ") is not supported. Upgrade 
to at least "
+            + oldRelease + " before upgrading to " + Constants.VERSION);
+      }
+

Review Comment:
   In thinking about this some more, I don't think this added message is ever 
going to work... this can only execute after the `UpgradeCoordinator` is 
instantiated... which won't happen until after the `Manager` is constructed... 
but the `Manager` won't successfully get constructed because 
`ServerContext.init` will fail long before this, when it runs 
`ServerContext.ensureDataVersionCompatible`, that checks 
`AccumuloDataVersion.CAN_RUN`.
   
   I think if you want to have this more informative message, you're going to 
need to edit `ServerContext.ensureDataVersionCompatible` instead and this added 
check can just be removed, as it's not doing anything useful here.



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

Reply via email to