Bug 461761

Summary: Make binding changes atomic
Product: Red Hat Enterprise MRG Reporter: Sergei Vorobiev <sergei.vorobiev>
Component: qpid-cppAssignee: Gordon Sim <gsim>
Status: CLOSED ERRATA QA Contact: Kim van der Riet <kim.vdriet>
Severity: low Docs Contact:
Priority: urgent    
Version: 1.0CC: cctrieloff, freznice, gsim, iboverma
Target Milestone: 1.1.1   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-21 16:16:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 479114    
Attachments:
Description Flags
Proposed change and simple test none

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