Fixing leveldb replication bug where loosing quorum did not properly restart the master in a clean way.

This commit is contained in:
Hiram Chirino 2013-10-02 11:42:58 -04:00
parent afc0220147
commit 0b66abcbfb
2 changed files with 12 additions and 0 deletions

View File

@ -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 = {

View File

@ -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