dlmarion commented on code in PR #5383:
URL: https://github.com/apache/accumulo/pull/5383#discussion_r2037183327


##########
server/base/src/main/java/org/apache/accumulo/server/util/UpgradeUtil.java:
##########
@@ -48,6 +59,17 @@ static class Opts extends ConfigOpts {
         description = "prepare an older version instance for an upgrade to a 
newer non-bugfix release."
             + " This command should be run using the older version of software 
after the instance is shut down.")
     boolean prepare = false;
+
+    @Parameter(names = "--start",
+        description = "Start an upgrade of an Accumulo instance. This will 
check that 'accumulo upgrade --prepare'"
+            + " was run on the instance after it was shut down, perform 
pre-upgrade validation, and perform any"
+            + " upgrade steps that need to occur before the Manager is 
started. Finally it creates a mandatory"

Review Comment:
   When the user runs `accumulo upgrade --prepare` in the previous version, it 
creates the node `Constants.ZPREPARE_FOR_UPGRADE`. This prevents any servers 
from starting. When the user runs `accumulo upgrade --start`it calls 
`UpgradeProgressTracker.initialize` which creates the UpgradeProgress object at 
`Constants.ZUPGRADE_PROGRESS` and removes `Constants.ZPREPARE_FOR_UPGRADE` so 
that the servers can start. 
   
   When the Manager starts and `isUpgrading()`, then it calls 
`UpgradeCoordinator.continueUpgrade()` at 
https://github.com/apache/accumulo/pull/5383/files#diff-07984c23da1745b22dd4fde5c4b8877dfb190ea19e5e60ab79d8a93e752031c7R331.
   
   `UpgradeCoordinator.continueUpgrade()` calls 
`UpgradeProgressTracker.continueUpgrade()` which throws an 
IllegalStateException if the `Constants.ZUPGRADE_PROGRESS` node does not exist. 
See: 
   
   
https://github.com/apache/accumulo/pull/5383/files#diff-8bcbc29fb85e21c8406937a7c532d443ca03dcc6769122dabd21da10aaafc06fR81
   
   The start of this call stack is in Manager.run() at 
https://github.com/apache/accumulo/blob/main/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java#L1165-L1167
   
   So the IllegalStateException should cause Manager.run to exit with no 
upgrade taking place.
   
   
   Regarding your question about checking all volumes, I think the answer is 
the code does not do that. AccumuloDataVersion.getCurrentVersion only checks 
the first volume and the 2.1 code looks the same.



-- 
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: notifications-unsubscr...@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to