ctubbsii commented on code in PR #3160:
URL: https://github.com/apache/accumulo/pull/3160#discussion_r1088015001
##########
server/manager/src/main/java/org/apache/accumulo/manager/upgrade/UpgradeCoordinator.java:
##########
@@ -142,11 +140,14 @@ 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;
+ if (cv < AccumuloDataVersion.ROOT_TABLET_META_CHANGES) {
+ throw new UnsupportedOperationException(
+ "Upgrading from a version before 2.1 is not supported. Upgrade to
2.1 before upgrading to 3.x");
+ }
+
Review Comment:
> Previously it was checked in each upgrader - the check here fails faster
and provided a clearer message than if the upgradeder fail the version checks -
failing with a message that upgrader for data version X is accurate, but may
not translate to the user how data versions and Accumulo versions correlate.
>
> On the positive side - this provides a clear user message at the expense
of needing to change the message if upgrades change - but that should be rare
and I favored a better user experience.
Okay, but if we want to tie the message to the version number, then we
should have some mapping of data version to the Accumulo version they appeared
in, so we don't have to update this line. The number of locations where we have
to made one or two character changes to keep all these messages accurate should
be few, and centralized. Something like:
```suggestion
if (cv < oldestVersion) {
String oldRelease = dataVersionToReleaseName.get(oldestVersion);
throw new UnsupportedOperationException(
"Upgrading from a version before " + oldRelease + " is not
supported. Upgrade to at least " + oldRelease + " before upgrading to " +
Constants.VERSION);
}
```
--
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]