Author: aconway
Date: Wed Nov 14 16:04:28 2012
New Revision: 1409243
URL: http://svn.apache.org/viewvc?rev=1409243&view=rev
Log:
QPID-4401: Revert: HA bindings for QMF exchanges not replicated.
This reverts r1403946: There was a problem with this, for example if I bind a
queue Q to receive broker events. On the backup, Q will receive double events:
from the replicating subscription to the primary and events generated locally in
the backup broker. That can cause the backup to generate "invalid position"
errors and shut down.
Modified:
qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp
qpid/trunk/qpid/cpp/src/tests/ha_tests.py
qpid/trunk/qpid/doc/book/src/cpp-broker/Active-Passive-Cluster.xml
Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp?rev=1409243&r1=1409242&r2=1409243&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp Wed Nov 14 16:04:28 2012
@@ -319,9 +319,9 @@ Broker::Broker(const Broker::Options& co
std::string qmfDirect("qmf.default.direct");
std::pair<Exchange::shared_ptr, bool> topicPair(
- exchanges.declare(qmfTopic, ManagementTopicExchange::typeName,
false));
+ exchanges.declare(qmfTopic, ManagementTopicExchange::typeName,
false, noReplicateArgs()));
std::pair<Exchange::shared_ptr, bool> directPair(
- exchanges.declare(qmfDirect, ManagementDirectExchange::typeName,
false));
+ exchanges.declare(qmfDirect, ManagementDirectExchange::typeName,
false, noReplicateArgs()));
boost::dynamic_pointer_cast<ManagementDirectExchange>(directPair.first)->setManagmentAgent(managementAgent.get(),
2);
boost::dynamic_pointer_cast<ManagementTopicExchange>(topicPair.first)->setManagmentAgent(managementAgent.get(),
2);
Modified: qpid/trunk/qpid/cpp/src/tests/ha_tests.py
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/ha_tests.py?rev=1409243&r1=1409242&r2=1409243&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/ha_tests.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/ha_tests.py Wed Nov 14 16:04:28 2012
@@ -807,31 +807,6 @@ acl deny all all
# The backup does not log this as an error so we only check the backup
log for errors.
self.assert_log_no_errors(cluster[1])
- def test_qmf_replication(self):
- """QPID-4401: Verify that QMF built-in exchanges have default
replication"""
- cluster = HaCluster(self, 2)
- cluster[0].wait_status("active")
- sn = cluster.connect(0).session()
- events =
sn.receiver("events;{create:always,node:{x-bindings:[{exchange:'qmf.default.topic',queue:'events',key:'agent.ind.event.org_apache_qpid_broker.#'}]}}")
- def verify_qmf_events(qname):
- sn.sender("%s;{create:always}"%(qname)).close() # Generate a QMF
event
- found = False
- try:
- while not found:
- m = events.fetch(timeout=1) # Receive
- def class_name(m): return
m.content[0]['_schema_id']['_class_name']
- def q_name(m): return m.content[0]['_values']['qName']
- if class_name(m) == 'queueDeclare' and q_name(m) == qname:
found = True
- except Empty: pass
- assert(found)
- try:
- l = LogLevel(ERROR) # Hide expected WARNING log messages from
failover.
- verify_qmf_events("q1")
- cluster[1].wait_status("ready")
- cluster.kill(0)
- verify_qmf_events("q2")
- finally: l.restore()
-
def test_missed_recreate(self):
"""If a queue or exchange is destroyed and one with the same name
re-created
while a backup is disconnected, the backup should also delete/recreate
Modified: qpid/trunk/qpid/doc/book/src/cpp-broker/Active-Passive-Cluster.xml
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/doc/book/src/cpp-broker/Active-Passive-Cluster.xml?rev=1409243&r1=1409242&r2=1409243&view=diff
==============================================================================
--- qpid/trunk/qpid/doc/book/src/cpp-broker/Active-Passive-Cluster.xml
(original)
+++ qpid/trunk/qpid/doc/book/src/cpp-broker/Active-Passive-Cluster.xml Wed Nov
14 16:04:28 2012
@@ -594,9 +594,14 @@ NOTE: fencing is not shown, you must con
<para>
There are some built-in exchanges created automatically by the broker,
these
exchangs are never replicated. The built-in exchanges are the default
(nameless)
- exchange, the AMQP standard exchanges (amq.direct, amq.topic, amq.fanout
and
- amq.match) and the management exchanges (qpid.management,
qmf.default.direct and
- qmf.default.topic)
+ exchange, the AMQP standard exchanges (<literal>amq.direct, amq.topic,
amq.fanout</literal> and
+ <literal>amq.match</literal>) and the management exchanges
(<literal>qpid.management, qmf.default.direct</literal> and
+ <literal>qmf.default.topic</literal>)
+ </para>
+ <para>
+ Note that if you bind a replicated queue to one of these exchanges, the
+ binding wil <emphasis>not</emphasis> be replicated, so the queue will not
+ have the binding after a fail-over.
</para>
</section>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]