helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [helix] branch master updated: fix version comparison issue in compatibility check stage (#992)
Date Mon, 04 May 2020 17:38:31 GMT
This is an automated email from the ASF dual-hosted git repository.

jxue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git


The following commit(s) were added to refs/heads/master by this push:
     new 2f73e8c  fix version comparison issue in compatibility check stage (#992)
2f73e8c is described below

commit 2f73e8cfad9d37248808f4acfab2be5861bcbfa7
Author: Meng Zhang <mnzhang@linkedin.com>
AuthorDate: Mon May 4 10:38:23 2020 -0700

    fix version comparison issue in compatibility check stage (#992)
---
 helix-core/src/main/java/org/apache/helix/HelixManagerProperties.java   | 2 ++
 .../org/apache/helix/controller/stages/CompatibilityCheckStage.java     | 2 +-
 .../org/apache/helix/controller/stages/TestCompatibilityCheckStage.java | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/helix-core/src/main/java/org/apache/helix/HelixManagerProperties.java b/helix-core/src/main/java/org/apache/helix/HelixManagerProperties.java
index bed8a68..94d9025 100644
--- a/helix-core/src/main/java/org/apache/helix/HelixManagerProperties.java
+++ b/helix-core/src/main/java/org/apache/helix/HelixManagerProperties.java
@@ -116,6 +116,8 @@ public class HelixManagerProperties {
 
         if (versionNum1 < versionNum2) {
           return false;
+        } else if (versionNum1 > versionNum2) {
+          break;
         }
       } catch (Exception e) {
         // ignore non-numerical strings and strings after non-numerical strings
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/CompatibilityCheckStage.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/CompatibilityCheckStage.java
index 70e3444a..59e110e 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/CompatibilityCheckStage.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/CompatibilityCheckStage.java
@@ -55,7 +55,7 @@ public class CompatibilityCheckStage extends AbstractBaseStage {
             "incompatible participant. pipeline will not continue. " + "controller: "
                 + manager.getInstanceName() + ", controllerVersion: " + properties.getVersion()
                 + ", minimumSupportedParticipantVersion: "
-                + properties.getProperty("miminum_supported_version.participant")
+                + properties.getProperty("minimum_supported_version.participant")
                 + ", participant: " + liveInstance.getInstanceName() + ", participantVersion:
"
                 + participantVersion;
         LogUtil.logError(LOG, event.getEventId(), errorMsg);
diff --git a/helix-core/src/test/java/org/apache/helix/controller/stages/TestCompatibilityCheckStage.java
b/helix-core/src/test/java/org/apache/helix/controller/stages/TestCompatibilityCheckStage.java
index f910da5..5631fe4 100644
--- a/helix-core/src/test/java/org/apache/helix/controller/stages/TestCompatibilityCheckStage.java
+++ b/helix-core/src/test/java/org/apache/helix/controller/stages/TestCompatibilityCheckStage.java
@@ -82,7 +82,7 @@ public class TestCompatibilityCheckStage extends BaseStageTest {
 
   @Test
   public void testCompatible() {
-    prepare("0.4.0", "0.4.0");
+    prepare("1.0.0", "1.0.0", "0.4");
     CompatibilityCheckStage stage = new CompatibilityCheckStage();
     StageContext context = new StageContext();
     stage.init(context);


Mime
View raw message