ActiveMQ replicated leveldb update ordering with zookeeper.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ActiveMQ replicated leveldb update ordering with zookeeper.

Steven Turner
Hi,


1. Updates from master to slaves are sequential or parallel ? If sequential , does master randomly choose a slave each time or is there some order in which message will go (like master->slave1 and than master->slave2).

2. How zk communicate with each broker and in what interval ? As mentioned here http://activemq.apache.org/replicated-leveldb-store.html that the slave with the latest update gets promoted to become the master.  How does zk knows which broker has the latest update ? Does zk get notifications from the slaves for each update ?

Thanks,
Steven

Reply | Threaded
Open this post in threaded view
|

Re: ActiveMQ replicated leveldb update ordering with zookeeper.

Steven Turner
Please respond .
Reply | Threaded
Open this post in threaded view
|

Re: ActiveMQ replicated leveldb update ordering with zookeeper.

Steven Turner
Did anyone get a chance to look at this ?
Reply | Threaded
Open this post in threaded view
|

Re: ActiveMQ replicated leveldb update ordering with zookeeper.

Steven Turner
In reply to this post by Steven Turner
Hi,

I was checking the source code of ActiveMQ and found this (MasterElector,scala):

------------------------------------------------------------
 // Do we need to elect a new master?
              if (elected == null) {
                // Find the member with the most updates.
                val sortedMembers = members.filter(_._2.position >= 0).sortWith {
                  (a, b) => {
                    a._2.position > b._2.position ||
                      (a._2.position == b._2.position &&  a._2.weight > b._2.weight )
                  }
                }
------------------------------------------------------------

Does it mean ActiveMQ itself takes care of master election ?
If zookpeer handles master election, how does it gets to know about latest log position. I am confused here. Can someone help me ?

Thanks,
Steven