diff options
| author | Alan Conway <aconway@apache.org> | 2012-10-02 21:46:50 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2012-10-02 21:46:50 +0000 |
| commit | e51687ee546a38934c672143074eda2de82306bd (patch) | |
| tree | 1cef1b6e69d152ce300d526fae2a32eb31f7ae2d /qpid/cpp/src/tests | |
| parent | b45b6daf6121e3f069de938439e1e37ff0cf7cc1 (diff) | |
| download | qpid-python-e51687ee546a38934c672143074eda2de82306bd.tar.gz | |
QPID-4285: HA backups continuously disconnect / re-sync after attempting to replicate a deleted queue
Fixes queues getting into a partially deleted state: previously when a broker was
promoted, it did not clean up it's QueueReplicators. The QueueReplicators keep a
shared_ptr to the Queue so this kept Queues in memory after they were destroyed. It also
kept them in QMF, since the management object is unregistered in the destructor.
This patch cleans up properly on promotion.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1393201 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests')
| -rwxr-xr-x | qpid/cpp/src/tests/ha_tests.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/qpid/cpp/src/tests/ha_tests.py b/qpid/cpp/src/tests/ha_tests.py index 86f33d8030..f1620cf55d 100755 --- a/qpid/cpp/src/tests/ha_tests.py +++ b/qpid/cpp/src/tests/ha_tests.py @@ -648,6 +648,24 @@ acl deny all all self.assertRaises(NotFound, s.receiver, ("e1")); + def test_auto_delete_qpid_4285(self): + """Regression test for QPID-4285: an auto delete queue gets stuck in + a partially deleted state and causes replication errors.""" + cluster = HaCluster(self,2) + cluster[1].wait_status("ready") + s = cluster[0].connect().session() + s.receiver("q;{create:always}") + cluster[1].wait_backup("q") + cluster.kill(0) # Make the backup take over. + s = cluster[1].connect().session() + s.receiver("q;{delete:always}").close() # Delete q on new primary + try: + s.receiver("q") + self.fail("Expected NotFound exception") # Should not be avaliable + except NotFound: pass + assert not cluster[1].agent().getQueue("q") # Should not be in QMF + + def fairshare(msgs, limit, levels): """ Generator to return prioritised messages in expected order for a given fairshare limit @@ -660,7 +678,7 @@ def fairshare(msgs, limit, levels): msgs = postponed count = 0 last_priority = None - postponed = [] + postponed = [ ] msg = msgs.pop(0) if last_priority and priority_level(msg.priority, levels) == last_priority: count += 1 |
