Bug 461761 - Make binding changes atomic
Summary: Make binding changes atomic
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: 1.0
Hardware: All
OS: Linux
urgent
low
Target Milestone: 1.1.1
: ---
Assignee: Gordon Sim
QA Contact: Kim van der Riet
URL:
Whiteboard:
Depends On:
Blocks: 479114
TreeView+ depends on / blocked
 
Reported: 2008-09-10 13:24 UTC by Sergei Vorobiev
Modified: 2009-04-21 16:16 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-04-21 16:16:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed change and simple test (3.60 KB, patch)
2009-01-02 17:11 UTC, Gordon Sim
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2009:0434 0 normal SHIPPED_LIVE Red Hat Enterprise MRG Messaging and Grid Version 1.1.1 2009-04-21 16:15:50 UTC

Description Sergei Vorobiev 2008-09-10 13:24:16 UTC
I believe at this point the changes made to MRG queue bindings are not atomic, which might create a problem in HA environments in case of recovery/failover.

Comment 1 Gordon Sim 2008-09-10 14:01:32 UTC
Bind requests should be idempotent though, therefore a request can be safely retried on failover if it had not completed successfully; if it does complete succesfully it will have been replicated.

However, a separate issue is that multiple bind requests can not be made atomic w.r.t. the incoming message stream. 

E.g. Assume there is an exchange, e, and two queues q-a and q-b, with q-a initially bound to e by key 'k'. We now wish to change the route for messages with that key such that they now go to q-b. If we do bind(e, 'k', q-b), then unbind(e, 'k', q-a), its possible that a message arriving after the bind and before the unbind will be added to both queues. If on the other hand we do the unbind before the bind, a message arriving between these two operations may be lost.

Can I clarify whether it is this latter case that is of concern here?

Comment 2 Sergei Vorobiev 2008-09-12 13:31:18 UTC
The latter is my concern.

Comment 3 Gordon Sim 2009-01-02 17:11:50 UTC
Created attachment 328080 [details]
Proposed change and simple test

The attached patch adds a 'qpid.exclusive-binding' option to the exchange-bind method for a direct exchange. If this key is present in the arguments to the bind, the exchange in question will ensure that this is the only binding with the given key.

In other words if you issue a bind with this option specified, it acts as an atomic 'rebind', deleting any existing binding with that key and adding in the requested binding.

Comment 4 Gordon Sim 2009-01-07 11:08:45 UTC
Committed as r732297

Comment 6 Frantisek Reznicek 2009-02-26 10:29:58 UTC
RHTS test qpid_compilation_tests and manual testing on RHEL 4.7 / 5.3 i386 / x86_64 proved that exclusive binding is implemented and working as tested with 
ClientSessionTest.cpp's testExclusiveBinding on packages:
qpidd-0.4.744917-1.el4/5, rhm-0.4.3116-3.el4/5

->VERIFIED

Comment 8 errata-xmlrpc 2009-04-21 16:16:25 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-0434.html


Note You need to log in before you can comment on or make changes to this bug.