Bug 743099 - mgsGroups: messages can be dequeued in different order than they were produced using one consumer
Summary: mgsGroups: messages can be dequeued in different order than they were produce...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: Development
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
: ---
Assignee: Ken Giusti
QA Contact: MRG Quality Engineering
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-03 20:16 UTC by Petr Matousek
Modified: 2012-01-13 16:50 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-13 16:50:32 UTC
Target Upstream Version:


Attachments (Terms of Use)
test reproducer (1.52 KB, text/python)
2011-10-03 20:19 UTC, Petr Matousek
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 734115 1 None None None 2021-01-20 06:05:38 UTC

Internal Links: 734115

Description Petr Matousek 2011-10-03 20:16:33 UTC
Description of problem:

N+1'th message in the group can be consumed by the same consumer even if the N'th message has not been acknowledged by the consumer.

Version-Release number of selected component (if applicable):
qpidd (qpidc) version 0.13
snv branch QPID-3346 (revision 1177617)

How reproducible:
100%

Steps to Reproduce:
1. run the attached test reproducer
  
Actual results:
other messages can be processed before the previously queued message is acknowledged even if they belong to the same group

Expected results:
N+1'th message in the group would be blocked until the N'th message has been accepted (or rejected) by a client.

Additional info:

there is just one consumer on already existing queue with qpid.group_header_key set, and the following messages queued:
message1 (group header set to "A")
message2 (group header set to "A")

a.) consumer consumed the first available message, the message
was not acknowledged:
  message1 was received
b.) consumer consumed all available messages:
  message2 was received
c.) session is closed
d.) now another session is established and the new consumer is
consuming all available messages:
  message1 is redelivered

This means that the second message in the queue was processed before
the first message was acknowledged. No message shall be received in step b. 

This is in conflict with the point 3 of the example described in the following document: https://docspace.corp.redhat.com/docs/DOC-69575
(Until the first message from "A" is accepted or rejected, all remaining messages in group "A" are blocked)

The behaviour is the same even if the receiver capacity is set to 1.

Comment 1 Petr Matousek 2011-10-03 20:19:04 UTC
Created attachment 526124 [details]
test reproducer

Comment 2 Ken Giusti 2011-11-02 19:13:30 UTC
Hi Petr,

The example above does violate the desired ordering rules, but it really isn't a bug in the broker.  The broker can only order the delivery of messages to consumers.  If the consumer acknowledges messages too early, or out of order, or releases some messages and acknowledges others, then strict sequenced consumption cannot be guaranteed.

This feature is a little weird in that it -requires- the consumers to follow certain consumption rules, but the broker really can't prevent them from violating them (and, in fact, some applications may need to behave this way).

I've updated the upstream documentation to be a bit clearer regarding how consumers need to behave - take a look in qpid/doc/book and try building the C++ broker guide.  There's a section on message groups in that document that is the "official" documentation - take a look at let me know if it needs more work.

Latest changes to that document were committed @ r1196764


Note You need to log in before you can comment on or make changes to this bug.