activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject [2/2] git commit: Fixing leveldb replication bug where loosing quorum did not properly restart the master in a clean way.
Date Wed, 02 Oct 2013 16:15:42 GMT
Fixing leveldb replication bug where loosing quorum did not properly restart the master in
a clean way.


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

Branch: refs/heads/trunk
Commit: 0b66abcbfbf22f07ac65c4d8cc9b02cd7f75e122
Parents: afc0220
Author: Hiram Chirino <hiram@hiramchirino.com>
Authored: Wed Oct 2 11:42:58 2013 -0400
Committer: Hiram Chirino <hiram@hiramchirino.com>
Committed: Wed Oct 2 12:15:36 2013 -0400

----------------------------------------------------------------------
 .../leveldb/replicated/ElectingLevelDBStore.scala        | 11 +++++++++++
 .../activemq/leveldb/replicated/MasterElector.scala      |  1 +
 2 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/0b66abcb/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala
----------------------------------------------------------------------
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 4595a1b..decc506 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
@@ -240,6 +240,17 @@ class ElectingLevelDBStore extends ProxyLevelDBStore {
       stopped_latch.countDown()
       func
     })
+    master.blocking_executor.execute(^{
+      val broker = brokerService
+      if( broker!=null ) {
+        try {
+            broker.requestRestart();
+            broker.stop();
+        } catch {
+          case e:Exception=> warn("Failure occurred while restarting the broker", e);
+        }
+      }
+    })
   }
 
   def objectName = {

http://git-wip-us.apache.org/repos/asf/activemq/blob/0b66abcb/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/MasterElector.scala
----------------------------------------------------------------------
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 84f93d0..c1c4c0c 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
@@ -160,6 +160,7 @@ class MasterElector(store: ElectingLevelDBStore) extends ClusteredSingleton[Leve
         updating_store = true
         store.stop_master {
           elector.synchronized {
+            updating_store = false
             info("Master stopped")
             address = null
             changed


Mime
View raw message