Github user yufeldman commented on a diff in the pull request:
https://github.com/apache/drill/pull/474#discussion_r59297387
--- 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 --
So for Drillbit with version 1.6 Drillbit with version 1.7 will be
included, while for a Drillbit with version 1.7 Drillbit with version 1.6 will
not be included? Does it mean that at any particular time a particular
Drillbit will have different view on the cluster from some other Drillbit?
---
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.
---