Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 557159

Summary: Queue-Purge does not send messages to alternate-exchange
Product: Red Hat Enterprise MRG Reporter: Ted Ross <tross>
Component: qpid-qmfAssignee: Ted Ross <tross>
Status: CLOSED ERRATA QA Contact: Jan Sarenik <jsarenik>
Severity: medium Docs Contact:
Priority: high    
Version: 1.2CC: iboverma, jsarenik
Target Milestone: 1.3   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
When a queue with an alternate exchange was deleted, its messages were sent to the alternate exchange. When such a queue was purged via the management command, the messages were not sent to the alternate exchange. With this update, the alternate exchange contains an equal number of messages as those purged from the queue.
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-14 16:10:54 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:

Description Ted Ross 2010-01-20 15:52:57 UTC
Description of problem:

When a queue with an alternate exchange is deleted, its messages are sent to the alternate exchange.  When such a queue is purged via the management command, the messages are not sent to the alternate exchange.

Version-Release number of selected component (if applicable):

1.2

How reproducible:

100%

Steps to Reproduce:
1. Create a queue with an alternate exchange

$ qpid-config add queue test --alternate-exchange amq.fanout

2. Produce messages that get placed into the queue
3. Purge the queue (using qpid-tool)
4. Using qpid-stat -e, check the counters on amq.fanout (the alternate)
  
Actual results:

amq.fanout has no msgIn count.

Expected results:

amq.fanout should have msgIn equal to the number of messages purged from the queue.


Additional info:

Comment 2 Ted Ross 2010-02-02 13:03:13 UTC
Fixed upstream at revision 904654.

The Queue.Purge method was not changed, a new method was added called "Reroute" which provides the needed functionality.  Reroute allows removed messages to be sent to the alternate exchange, or any other exchange by name.

Comment 4 Jan Sarenik 2010-10-05 12:16:49 UTC
I doubt it is working in current candidate:

# Start fresh qpidd
qpid-config add queue test --alternate-exchange amq.fanout
qpid-stat -q | grep test
echo "test" | /opt/rh-qpid/clients/sender --routing-key test
qpid-stat -q | grep test
# You should see one message being added
qpid-stat -e | grep amq.fanout 
# No messages are in this exchange so far
qpid-tool
#  list queue
#  show <test-queue.ID>
#  call <test-queue.ID> purge 0
#  # wait few seconds
#  show <test-queue.ID>
#  # you should see the message is not there already
qpid-stat -e | grep amq.fanout 
# no, it does not get to fanout

When you run "qpid-config del queue test --force" instead of
purging it via qpid-tool, the final qpid-stat proves that the
messages go into the amq.fanout.

Tested on
  python-qpid-0.7.946106-14.el5
  python-qmf-0.7.946106-13.el5
  qpid-cpp-server-0.7.946106-17.el5
  qpid-tools-0.7.946106-11.el5

Comment 5 Jan Sarenik 2010-10-05 12:39:49 UTC
Sorry, according to comment #2 I should not call "purge" method
anymore, but the "reroute" one.

Comment 6 Jan Sarenik 2010-10-05 12:54:35 UTC
Verified on i386 and x86_64 RHEL4
  qpid-cpp-server-0.7.946106-17.el4
  python-qpid-0.7.946106-14.el4
  python-qmf-0.7.946106-13.el4
  qpid-tools-0.7.946106-11.el4

and x86_64 RHEL5
  python-qpid-0.7.946106-14.el5
  python-qmf-0.7.946106-13.el5
  qpid-cpp-server-0.7.946106-17.el5
  qpid-tools-0.7.946106-11.el5

Comment 7 Jan Sarenik 2010-10-06 08:14:45 UTC
call <test-queue.ID> reroute true amq.fanout

Verified also on RHEL5 i386
  python-qpid-0.7.946106-14.el5
  python-qmf-0.7.946106-13.el5
  qpid-cpp-server-0.7.946106-17.el5
  qpid-tools-0.7.946106-11.el5

Comment 8 Martin Prpič 2010-10-07 13:50:20 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
When a queue with an alternate exchange was deleted, its messages were sent to the alternate exchange. When such a queue was purged via the management command, the messages were not sent to the alternate exchange. With this update, the alternate exchange contains an equal number of messages as those purged from the queue.

Comment 10 errata-xmlrpc 2010-10-14 16:10:54 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/RHSA-2010-0773.html