Bug 1121660

Summary: [AMQP 1.0] Broker restart failure with durable topic using non-durable exchange
Product: Red Hat Enterprise MRG Reporter: Valiantsina Hubeika <vhubeika>
Component: qpid-cppAssignee: Kim van der Riet <kim.vdriet>
Status: CLOSED CURRENTRELEASE QA Contact: Eric Sammons <esammons>
Severity: high Docs Contact:
Priority: high    
Version: DevelopmentCC: esammons, gsim, iboverma, jross, zkraus
Target Milestone: 3.0   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qpid-cpp-0.22-46 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:

Description Valiantsina Hubeika 2014-07-21 13:56:54 UTC
Description of problem:

Broker restart fails with durable topic created with a non-durable exchange.


Version-Release number of selected component (if applicable):
qpid-cpp-0.22-42

How reproducible:
100%

Steps to Reproduce:
1. qpid-config add exchange fanout test.ex
2. qpid-config add topic test.topic --argument exchange=test.ex --argument durable=True
3. service qpidd restart

Actual results:

root @rhel6i ~ $ 15:41:07 # service qpidd restart
Stopping Qpid AMQP daemon:                                 [  OK  ]
Starting Qpid AMQP daemon: Daemon startup failed: not-found: Exchange not found: test.ex (/builddir/build/BUILD/qpid-0.22/cpp/src/qpid/broker/ExchangeRegistry.cpp:144)
                                                           [FAILED]


Expected results:

Broker starts successfully. Or an attempt to create a durable topic with non-durable exchange returns an error.

Additional info:

Comment 2 Kim van der Riet 2014-07-21 19:45:19 UTC
I am assuming legacystore. I can't reproduce this error based soley on a recovery. In my tests, the broker recovers test.topic ok:

qpid: list exchange
Object Summary:
    ID   Created   Destroyed  Index
    ==================================================
    117  19:07:01  -          138.
    118  19:07:01  -          138.amq.direct
    119  19:07:01  -          138.amq.fanout
    120  19:07:01  -          138.amq.match
    121  19:07:01  -          138.amq.topic
    122  19:07:01  -          138.qmf.default.direct
    123  19:07:01  -          138.qmf.default.topic
    124  19:07:01  -          138.qpid.management
    125  19:07:01  -          138.test.topic

qpid: show 125
Object of type: org.apache.qpid.broker:exchange:_data(...)
    Attribute          125
    ==============================================
    vhostRef           138
    name               test.topic
    type               topic
    durable            True
    autoDelete         False
    altExchange        absent
    arguments          {u'exchange': u'test.ex'}
    ...

and even though test.ex does not exist, it does not fail with the error described above. The above description suggests the failure occurs somewhere in recovery - perhaps I am missing a step?


This raises the question on how to handle this case:

1. The operation which creates the durable topic exchange (step 2 above) should fail because it uses a non-durable exchange as an argument - this will need to be decected and handled within qpid-config.

2. The broker should handle this failure with an error message in the log. The error message can only say that the exchange is non-existent, but not why (deleting the exchange after creation, even if it is durable would presumably lead to the same result).

I'll continue to try to obtain the same result described above.

Comment 3 Valiantsina Hubeika 2014-07-22 08:33:02 UTC
I am sorry for confusion. I am talking here amqp1.0 topic object, not the topic exchange. Please try to use the 'Steps to Reproduce ' from the above.
To list the topic object you can use

qpid-config list topic
or 
qpid-tool : list topic

Also please note, this is new linear store.

Comment 4 Kim van der Riet 2014-08-04 19:27:15 UTC
I have this reproduced.

The error occurs when a Topic object is recoverd. It fails to handle the case when the exchange upon which it depends does not exist, and the exception is unhandled.

A proposed simple fix catches the exception, and allows existing code to print an error message that the topic recovery failed and allows the broker to continue recovery.

Further comments are on the upstream bug QPID-9548 (link above).

I am not very familiar with the new AMQP code; I would appreciate some reviews on this proposed fix:

https://reviews.apache.org/r/24251/

Comment 5 Gordon Sim 2014-08-06 17:42:22 UTC
Fixed upstream: https://svn.apache.org/r1616287

Comment 8 Valiantsina Hubeika 2014-08-11 09:08:45 UTC
At this moment, durable topic can be created only with a durable exchange (otherwise an exception is thrown).
Verified on
qpid-cpp-0.22-46