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


##########
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:
   With the changes - the error message now reads:
   
   ```2023-02-08T14:15:02,313 [start.Main] ERROR: Thread 'manager' died.
   java.lang.IllegalStateException: This version of accumulo (3.0.0-SNAPSHOT) 
is not compatible with files stored using data version 8. Please upgrade from 
2.1.0 or later.
           at 
org.apache.accumulo.server.ServerContext.ensureDataVersionCompatible(ServerContext.java:304)
 ~[accumulo-server-base-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
           at 
org.apache.accumulo.server.ServerContext.init(ServerContext.java:373) 
~[accumulo-server-base-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
           at 
org.apache.accumulo.server.AbstractServer.<init>(AbstractServer.java:50) 
~[accumulo-server-base-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
           at org.apache.accumulo.manager.Manager.<init>(Manager.java:412) 
~[accumulo-manager-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
           at org.apache.accumulo.manager.Manager.main(Manager.java:406) 
~[accumulo-manager-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
           at 
org.apache.accumulo.manager.ManagerExecutable.execute(ManagerExecutable.java:45)
 ~[accumulo-manager-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
           at 
org.apache.accumulo.start.Main.lambda$execKeyword$0(Main.java:122) 
~[accumulo-start-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
   
   
   ```



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