camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Willem Jiang (JIRA)" <>
Subject [jira] [Commented] (CAMEL-8208) ZooKeeperRoutePolicy is not able to recover after session expiration
Date Wed, 07 Jan 2015 05:28:35 GMT


Willem Jiang commented on CAMEL-8208:

I just checked the code of ZooKeeperRoutePolicy, it doesn't switch to the not master mode
if the node is disconnected.
So I made a patch for it, can you verify it in your system?
diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/policy/
index 3fb3eb1..180b738 100644
--- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/policy/
+++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/policy/
@@ -236,6 +236,10 @@ public class ZooKeeperElection {
                         LOG.debug("This node is number '{}' on the candidate list, election
is configured for the top '{}'. this node will be {}",
                                 new Object[]{location, enabledCount, masterNode.get() ? "enabled"
: "disabled"}
+                    } else {
+                        // Cannot find the location from the candidate, we need to reset
the masterNode state
+              "This node {} is session expirated, so it is switch to slave
mode.", candidateName);
+                        masterNode.set(false);

> ZooKeeperRoutePolicy is not able to recover after session expiration
> --------------------------------------------------------------------
>                 Key: CAMEL-8208
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-zookeeper
>    Affects Versions: 2.13.2
>            Reporter: Leo Wang
> My company is using ZooKeeperRoutePolicy to maintain a Master/Slaver cluster. Sometimes
the cluster got network problem which make the app server disconnect from remote ZooKeeper
server. The disconnection usually don't last long but still long enough to expire the zookeeper
session of ZooKeeperRoutePolicy. By our observation, it seems ZooKeeperRoutePolicy would not
recovery and do re-election after session expiration which lead to multiple master situation.
> Is it possible to do enhancement or bug fixing on this?

This message was sent by Atlassian JIRA

View raw message