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

Bug 504691

Summary: alternate-exchange proprty of exchange and queue are not persisted
Product: Red Hat Enterprise MRG Reporter: Gordon Sim <gsim>
Component: qpid-cppAssignee: Kim van der Riet <kim.vdriet>
Status: CLOSED ERRATA QA Contact: Jiri Kolar <jkolar>
Severity: high Docs Contact:
Priority: high    
Version: 1.0CC: jkolar
Target Milestone: 1.3   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously, an alternate exchange property was lost during a broker recovery, which may have caused some messages to be misdirected or even dropped. To prevent this, the alternate exchange property was added to the broker properties database, allowing it to be recovered.
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-14 16:08:17 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: 531561, 531921    
Bug Blocks:    

Description Gordon Sim 2009-06-08 19:59:19 UTC
Description of problem:

The alternate-exchange proprty of exchange and queue are not persisted so if an exchange (or a queue) with this property set is recovered the property will be lost.

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

1.1 and earlier

How reproducible:

100%

Steps to Reproduce:
1. create a durable exchange with the alternate-exchange property set
2. restart broker and check the state of the exchange
  
Actual results:

alternate-exchange property has been lost

Expected results:

alternate-exchange property should be rstored on recovery

Additional info:

Comment 2 Kim van der Riet 2009-10-28 17:41:57 UTC
Fixed in r.830687

No automated test exists yet, as python test framework does not yet support starting and stopping of brokers. To follow when this function is added.

QE: This can be tested for by hand as follows:
1. In a window, start a broker:
./qpidd --load-module /path/to/msgstore.so --auth no --data-dir /tmp --log-enable info+

2. In another window, add new durable exchanges with alternates set:
qpid-config add exchange direct kim-direct-exchange --durable --alternate-exchange "amq.direct"

The following will fail because the alt exch does not exist:
qpid-config add exchange fanout kim-fanout-exchange --durable --alternate-exchange "non-existent-exchange"
Failed: SessionException: exception(error_code=404, command_id=serial(48), class_code=7, command_code=1, field_index=0, description=u'not-found: Exchange not found: non-existent-exchange (qpid/broker/ExchangeRegistry.cpp:90)', error_info={})

qpid-config add exchange fanout kim-fanout-exchange --durable --alternate-exchange "amq.direct"

The following will be created, but without an alt exch. (ie "" is ignored):
qpid-config add exchange topic kim-topic-exchange --durable --alternate-exchange ""

3. Now check the exchanges:
qpid-config exchanges
Type      Exchange Name        Attributes
==================================================
direct                        
topic     qpid.management     
direct    amq.direct           --durable
topic     amq.topic            --durable
fanout    amq.fanout           --durable
headers   amq.match            --durable
direct    kim-direct-exchange  --durable --alternate-exchange=amq.direct
fanout    kim-fanout-exchange  --durable --alternate-exchange=amq.direct
topic     kim-topic-exchange   --durable

4. Stop the broker in the first window, then restart it.

5. Check the exchanges again, making sure that the alternates are the same as those above.

Leaving ASSIGNED until an automated test is checked in.

Comment 3 Kim van der Riet 2009-10-29 20:45:59 UTC
Queue persistence of alternate-exchange fixed in r.831082.

Currently no test exists for this, and checking by hand is hard because the qpid tools do not support displaying the alternate-exchange property for queues (although qpid-config can create a queue with this property). This was checked by placing debug messages in the recovery code to ensure that this property is set.

I will raise a bug against the qpid-tools to include this parameter. Once this is done, then a manual check similar to that for exchanges above will be possible.

Leaving ASSIGNED until an automated test is checked in.

Comment 5 Kim van der Riet 2009-11-04 15:12:00 UTC
With bug 531561 now fixed, it is possible to see the alternate exchange property of queues using qpid-config. A test similar to the above may be used to check this fix by hand:

qpid-config add exchange direct backup-exchange --durable
qpid-config add queue test --durable --alternate-exchange backup-exchange
qpid-config queues
Queue Name                 Attributes
==================================================
test                       --durable --file-size=24 --file-count=8 --alternate-exchange=backup-exchange
...

Stop broker
Restart broker

qpid-config queues
Queue Name                 Attributes
==================================================
test                       --durable --file-size=24 --file-count=8 --alternate-exchange=backup-exchange
...

Comment 6 Kim van der Riet 2009-12-14 19:43:30 UTC
Tests added for both exchange and queue alternate-exchange property persistence in r.3741 & 3742.

Comment 7 Jiri Kolar 2010-06-09 11:36:54 UTC
Tested:
on 752581 bug appears
on 946106 does not. It has been fixed

validated on RHEL 5.5/ RHEL4  i386 / x86_64  

packages:

# rpm -qa | grep -E '(qpid|openais|rhm)' | sort -u

openais-0.80.6-16.el5_5.1
openais-debuginfo-0.80.6-16.el5_5.1
python-qpid-0.7.946106-1.el5
qpid-cpp-client-0.7.946106-2.el5
qpid-cpp-client-devel-0.7.946106-2.el5
qpid-cpp-client-devel-docs-0.7.946106-2.el5
qpid-cpp-client-ssl-0.7.946106-2.el5
qpid-cpp-mrg-debuginfo-0.7.946106-1.el5
qpid-cpp-server-0.7.946106-2.el5
qpid-cpp-server-cluster-0.7.946106-2.el5
qpid-cpp-server-devel-0.7.946106-2.el5
qpid-cpp-server-ssl-0.7.946106-2.el5
qpid-cpp-server-store-0.7.946106-2.el5
qpid-cpp-server-xml-0.7.946106-2.el5
qpid-java-client-0.7.946106-3.el5
qpid-java-common-0.7.946106-3.el5
qpid-tools-0.7.946106-4.el5
rhm-docs-0.7.946106-1.el5

->VERIFIED

Comment 8 Kim van der Riet 2010-10-05 15:21:09 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:
Cause: Recovering a broker with an alternate exchange property set will lose that property.
Consequence: The alternate exchange property is lost after recovery, and may result in some messages being dropped or misdirected.
Fix: The alternate exchange property was added to the broker properties database
Result: A broker with an alternate exchange property set can now be recovered without losing that property.

Comment 9 Jaromir Hradilek 2010-10-06 14:45:12 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,4 +1 @@
-Cause: Recovering a broker with an alternate exchange property set will lose that property.
+Previously, an alternate exchange property was lost during a broker recovery, which may have caused some messages to be misdirected or even dropped. To prevent this, the alternate exchange property was added to the broker properties database, allowing it to preserve.-Consequence: The alternate exchange property is lost after recovery, and may result in some messages being dropped or misdirected.
-Fix: The alternate exchange property was added to the broker properties database
-Result: A broker with an alternate exchange property set can now be recovered without losing that property.

Comment 10 Jaromir Hradilek 2010-10-13 15:11:11 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-Previously, an alternate exchange property was lost during a broker recovery, which may have caused some messages to be misdirected or even dropped. To prevent this, the alternate exchange property was added to the broker properties database, allowing it to preserve.+Previously, an alternate exchange property was lost during a broker recovery, which may have caused some messages to be misdirected or even dropped. To prevent this, the alternate exchange property was added to the broker properties database, allowing it to be recovered.

Comment 12 errata-xmlrpc 2010-10-14 16:08:17 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