You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by zz...@apache.org on 2014/11/10 22:44:07 UTC

helix git commit: [HELIX-541] set upper_bound to R+1 to avoid live-lock, rb=27822

Repository: helix
Updated Branches:
  refs/heads/helix-0.6.x 9f024327c -> de238d68e


[HELIX-541] set upper_bound to R+1 to avoid live-lock, rb=27822


Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/de238d68
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/de238d68
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/de238d68

Branch: refs/heads/helix-0.6.x
Commit: de238d68efbc63374470aa15ca552e81147a1cc9
Parents: 9f02432
Author: zzhang <zz...@apache.org>
Authored: Mon Nov 10 13:41:32 2014 -0800
Committer: zzhang <zz...@apache.org>
Committed: Mon Nov 10 13:41:32 2014 -0800

----------------------------------------------------------------------
 .../apache/helix/controller/stages/MessageSelectionStage.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/de238d68/helix-core/src/main/java/org/apache/helix/controller/stages/MessageSelectionStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageSelectionStage.java b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageSelectionStage.java
index 9a420aa..f3a8257 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageSelectionStage.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageSelectionStage.java
@@ -209,6 +209,8 @@ public class MessageSelectionStage extends AbstractBaseStage {
           }
 
           if (newLowerBound < stateConstraints.get(fromState).getLowerBound()) {
+            LOG.info("Reach lower_bound: " + stateConstraints.get(fromState).getLowerBound()
+                + ", not send message: " + message);
             continue;
           }
         }
@@ -217,6 +219,8 @@ public class MessageSelectionStage extends AbstractBaseStage {
         if (stateConstraints.containsKey(toState)) {
           int newUpperBound = bounds.get(toState).getUpperBound() + 1;
           if (newUpperBound > stateConstraints.get(toState).getUpperBound()) {
+            LOG.info("Reach upper_bound: " + stateConstraints.get(toState).getUpperBound()
+                + ", not send message: " + message);
             continue;
           }
         }
@@ -249,7 +253,8 @@ public class MessageSelectionStage extends AbstractBaseStage {
         // idealState is null when resource has been dropped,
         // R can't be evaluated and ignore state constraints
         if (idealState != null) {
-          max = cache.getReplicas(idealState.getResourceName());
+          // HELIX-541: set upper_bound to R+1 to avoid live-lock
+          max = cache.getReplicas(idealState.getResourceName()) + 1;
         }
       } else {
         try {