Bug 916975
| Summary: | Journal can not manage enqueues matching two bindings from headers exchange to the same queue | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise MRG | Reporter: | Pavel Moravec <pmoravec> | ||||
| Component: | qpid-cpp | Assignee: | Pavel Moravec <pmoravec> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Zdenek Kraus <zkraus> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 2.3 | CC: | esammons, freznice, jkocnova, jross, pmoravec, sauchter, zkraus | ||||
| Target Milestone: | 3.1 | Keywords: | TestCaseProvided, WorkAround | ||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | qpid-cpp-0.30-2 | Doc Type: | Bug Fix | ||||
| Doc Text: |
It was discovered that if a message sent to a headers exchange matched two bindings to the same queue, the queue attempted to enqueue the message twice. This caused a journal exception when the queue attempted to store the message. The headers exchange implementation has been improved to ensure there is just one enqueue made in these circumstances. This prevents the journal exception from occurring, and fixes the originally reported issue.
|
Story Points: | --- | ||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2015-04-14 13:46:28 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Pavel Moravec
2013-03-01 10:32:34 UTC
Effective workaround: prevent having more bindings from a headers exchange to the same queue such that a message can match more bindings. Example: instead of having: $ qpid-config bind amq.match MyQueue MyQueue.1 all prop1=1 prop2=1 $ qpid-config bind amq.match MyQueue MyQueue.2 all prop1=1 prop3=1 where a message with properties prop1=1 and prop2=1 and prop3=1 matches both bindings, change the bindings to: $ qpid-config bind amq.match MyQueue MyQueue.1 all prop1=1 prop2=1 $ qpid-config bind amq.match MyQueue MyQueue.2 all prop1=1 prop3=1 prop2!=1 Now, with the new restriction on second binding, the bindings have mutually exclusive binding keys. Created attachment 834835 [details]
Patch proposal
Patch proposal - simple but maybe not ideal.
Root cause of the bug: HeadersExchange::route method generates BindingList that may contain multiple bindings to the same queue. That causes a message to be enqueued to the same queue more than once.
The patch sorts+makes unique the BindingList by using std::map < Queue , Binding > (boost pointers in fact). Maybe there is more elegant way of doing so, anyway this patch fixes the problem (no automated tests run so far).
(In reply to Pavel Moravec from comment #3) > Created attachment 834835 [details] > Patch proposal > > Patch proposal - simple but maybe not ideal. > > Root cause of the bug: HeadersExchange::route method generates BindingList > that may contain multiple bindings to the same queue. That causes a message > to be enqueued to the same queue more than once. > > The patch sorts+makes unique the BindingList by using std::map < Queue , > Binding > (boost pointers in fact). Maybe there is more elegant way of doing > so, anyway this patch fixes the problem (no automated tests run so far). FYI the bug is _not_ in store but in broker itself. Per gsim, a message matching multiple bindings to same queue should be enqueued just once to the queue. That is now fixed by the patch for headers exchange. Upstream review request: https://reviews.apache.org/r/17641/ Committed to upstream: r1563863. This bug is UNABLE TO REPRODUCE with: qpid-cpp-server-0.18-14 and qpid-cpp-server-store-0.18-14 on RHEL x86_64 There is no such exception. I managed to reproduce the issue with qpid-cpp-0.18-36 with use of our testing clients. Unfortunatelly I cannot find a reason why qpid-send do not cause the issue. Issue was tested on RHEL 6.6, RHEL 7.1 with following packages: python-qpid-0.30-6 python-qpid-qmf-0.30-6 qpid-tools-0.30-5 qpid-cpp-server-linearstore-0.30-8 qpid-proton-c-0.9-2 qpid-cpp-server-0.30-8 qpid-cpp-client-devel-0.30-8 qpid-qmf-0.30-6 qpid-java-common-0.30-5 qpid-java-example-0.30-5 qpid-cpp-server-rdma-0.30-8 qpid-cpp-server-ha-0.30-8 qpid-cpp-server-xml-0.30-8 qpid-cpp-client-devel-docs-0.30-8 qpid-cpp-client-0.30-8 qpid-cpp-client-rdma-0.30-8 qpid-java-client-0.30-5 qpid-cpp-server-devel-0.30-8 qpid-cpp-debuginfo-0.30-8 Bindings work as expected (Comment 9). -> VERIFIED Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHEA-2015-0805.html |