From 8804341c19f7f9450f22cef8fb842ffab31b5e5f Mon Sep 17 00:00:00 2001 From: Hiram Chirino Date: Wed, 2 Oct 2013 10:45:47 -0400 Subject: [PATCH] Adding more debug info to help trouble shoot election issues with leveldb replication elections. --- .../activemq/leveldb/replicated/ElectingLevelDBStore.scala | 2 ++ .../org/apache/activemq/leveldb/replicated/MasterElector.scala | 2 ++ 2 files changed, 4 insertions(+) diff --git a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala index 368ea96fff..4595a1b778 100644 --- a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala +++ b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala @@ -181,7 +181,9 @@ class ElectingLevelDBStore extends ProxyLevelDBStore { val zk_group = ZooKeeperGroupFactory.create(zk_client, zkPath) val master_elector = new MasterElector(this) + debug("Starting ZooKeeper group monitor") master_elector.start(zk_group) + debug("Joining ZooKeeper group") master_elector.join this.setUseLock(true) diff --git a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/MasterElector.scala b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/MasterElector.scala index b5d8e10271..84f93d0e09 100644 --- a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/MasterElector.scala +++ b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/MasterElector.scala @@ -90,6 +90,8 @@ class MasterElector(store: ElectingLevelDBStore) extends ClusteredSingleton[Leve } def changed:Unit = elector.synchronized { + debug("ZooKeeper group changed: %s", members) + // info(eid+" cluster state changed: "+members) if (isMaster) { // We are the master elector, we will choose which node will startup the MasterLevelDBStore