Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2F75A10579 for ; Wed, 2 Oct 2013 16:15:46 +0000 (UTC) Received: (qmail 67939 invoked by uid 500); 2 Oct 2013 16:15:45 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 67905 invoked by uid 500); 2 Oct 2013 16:15:42 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 67891 invoked by uid 99); 2 Oct 2013 16:15:41 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Oct 2013 16:15:41 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 503C88AE097; Wed, 2 Oct 2013 16:15:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chirino@apache.org To: commits@activemq.apache.org Date: Wed, 02 Oct 2013 16:15:42 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] git commit: Fixing leveldb replication bug where loosing quorum did not properly restart the master in a clean way. 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 Authored: Wed Oct 2 11:42:58 2013 -0400 Committer: Hiram Chirino 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