summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/ha_test.py
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2012-11-14 16:04:04 +0000
committerAlan Conway <aconway@apache.org>2012-11-14 16:04:04 +0000
commit3b9fdc8e68cb42e6ebfa75f3dc756fd54369f735 (patch)
tree128d1ac54182753c4d8f2d49ce38a5d88bea7909 /qpid/cpp/src/tests/ha_test.py
parentbce4ad2c993a34d240b1166ab6321bc14b78c612 (diff)
downloadqpid-python-3b9fdc8e68cb42e6ebfa75f3dc756fd54369f735.tar.gz
QPID-4428: HA add UUID tag to avoid using an out of date queue/exchange.
Imagine a cluster with primary A and backups B and C. A queue Q is created on A and replicated to B, C. Now A dies and B takes over as primary. Before C can connect to B, a client destroys Q and creates a new queue with the same name. When B connects it sees Q and incorrectly assumes it is the same Q that it has already replicated. Now C has an inconsistent replica of Q. The fix is to tag queues/exchanges with a UUID so a backup can tell if a queue is not the same as the one it has already replicated, even if the names are the same. This all also applies to exchanges. - Minor imrovements to printing UUIDs in a FieldTable. - Fix comparison of void Variants, added operator != git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1409241 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/ha_test.py')
-rwxr-xr-xqpid/cpp/src/tests/ha_test.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/qpid/cpp/src/tests/ha_test.py b/qpid/cpp/src/tests/ha_test.py
index 9eebfa952f..d7885d9622 100755
--- a/qpid/cpp/src/tests/ha_test.py
+++ b/qpid/cpp/src/tests/ha_test.py
@@ -142,7 +142,9 @@ class HaBroker(Broker):
# FIXME aconway 2012-05-01: do direct python call to qpid-config code.
def qpid_config(self, args):
assert subprocess.call(
- [self.qpid_config_path, "--broker", self.host_port()]+args) == 0
+ [self.qpid_config_path, "--broker", self.host_port()]+args,
+ stdout=1, stderr=subprocess.STDOUT
+ ) == 0
def config_replicate(self, from_broker, queue):
self.qpid_config(["add", "queue", "--start-replica", from_broker, queue])
@@ -160,12 +162,14 @@ class HaBroker(Broker):
else:
return Broker.connect(self, client_properties={"qpid.ha-admin":1}, **kwargs)
- def wait_backup(self, address):
- """Wait for address to become valid on a backup broker."""
+ def wait_address(self, address):
+ """Wait for address to become valid on the broker."""
bs = self.connect_admin().session()
try: wait_address(bs, address)
finally: bs.connection.close()
+ def wait_backup(self, address): self.wait_address(address)
+
def assert_browse(self, queue, expected, **kwargs):
"""Verify queue contents by browsing."""
bs = self.connect().session()