Github user arina-ielchiieva commented on a diff in the pull request:
https://github.com/apache/drill/pull/474#discussion_r59332891
--- Diff:
common/src/main/java/org/apache/drill/common/util/DrillVersionInfo.java ---
@@ -49,10 +53,52 @@ public static String getVersion() {
}
}
} catch (IOException except) {
- appVersion = "Unknown";
+ appVersion = UNKNOWN_VERSION;
}
return appVersion;
}
+ /**
+ * Compare two Drill versions disregarding build number and comparing
only major and minor versions.
+ * Versions are considered to be compatible:
+ * 1. if current version is the same as version to compare.
+ * 2. if current version minor version + 1 is the same as version to
compare.
+ */
+ public static boolean isVersionsCompatible(String currentVersion, String
versionToCompare) {
+ if (currentVersion != null && currentVersion.equals(versionToCompare))
{
+ return true;
+ }
+
+ BigDecimal currentVersionDecimal = getVersionAsDecimal(currentVersion);
+ BigDecimal versionToCompareDecimal =
getVersionAsDecimal(versionToCompare);
+
+ if (currentVersionDecimal != null && versionToCompareDecimal != null) {
--- End diff --
I guess, yes. Ideally all drillbits in cluster will be with the same
version, only during rolling upgrades this situation may occur.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---