[ https://issues.apache.org/jira/browse/DRILL-4596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15236773#comment-15236773 ]
ASF GitHub Bot commented on DRILL-4596: --------------------------------------- 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. > Drill should do version check among drillbits > --------------------------------------------- > > Key: DRILL-4596 > URL: https://issues.apache.org/jira/browse/DRILL-4596 > Project: Apache Drill > Issue Type: New Feature > Affects Versions: 1.6.0 > Reporter: Arina Ielchiieva > Assignee: Arina Ielchiieva > Fix For: Future > > > Before registering new drillbit in zookeeper, we should do version check, and > make sure all the running drillbits are in the same version. > Using drillbits of different version can lead to unexpected results. -- This message was sent by Atlassian JIRA (v6.3.4#6332)