Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.7.0
-
None
-
Windows 7, VS2010
-
Patch Available
Description
Master/Slave configuration with a shared data directory:
ActiveMQ Configuration (activemq.xml):
<persistenceAdapter>
<kahaDB directory="\\host1\kahadb"/>
</persistenceAdapter>
URL:
failover:(tcp://host1:port1,tcp://host2:port2)?randomize=false
Test case:
1) Run ActiveMQ on host2, it becomes the master
2) Run ActiveMQ on host1, it becomes the slave
3) Run a program that opens an ActiveMQ connection with the url
4) Shutdown ActiveMQ on host2
5) The ActiveMQ connection is not able to switch to host1.
Explanation:
The test case has randomize=false to be able to reproduce the problem anytime. If randomize=true, the problem occurs randomly.
At step 3, ActiveMQ-CPP tries to open first a connection with host1. It fails as host1 is the slave. Then it tries to open a connection with host2. This time, it succeeds but it forgets to put back the failure hosts (host1) to the broker list. At this point, the broker list = (host2).
At step 5, ActiveMQ-CPP tries to open a connection with the broker list. As the broker list = (host2), it will try to open a connection only with host2.