Bug 1082487 - [Selectors] prefix key is not selected
Summary: [Selectors] prefix key is not selected
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: 3.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 3.0
: ---
Assignee: Andrew Stitcher
QA Contact: Zdenek Kraus
URL:
Whiteboard:
Depends On:
Blocks: 453539
TreeView+ depends on / blocked
 
Reported: 2014-03-31 07:41 UTC by Zdenek Kraus
Modified: 2014-09-24 15:10 UTC (History)
4 users (show)

Fixed In Version: qpid-cpp-0.22-40
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-24 15:10:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Apache JIRA QPID-5725 0 None None None Never
Red Hat Product Errata RHEA-2014:1296 0 normal SHIPPED_LIVE Red Hat Enterprise MRG Messaging 3.0 Release 2014-09-24 19:00:06 UTC

Description Zdenek Kraus 2014-03-31 07:41:41 UTC
Description of problem:
when some key is a prefix of another key for example (c, color), the 'c' key is not selected by the broker selector

Version-Release number of selected component (if applicable):
qpid-cpp-0.22-36.el6.i686

How reproducible:
100%

Steps to Reproduce:
1. ./qc2_spout --log-msgs dict -c 1 -P color=red -P c=False --content "asdf" "q;{create:always}"
2. ./qc2_drain --log-msgs dict -c 1 "q;{link:{selector:\"c = false\"}}"

Actual results:
[1]
{'redelivered': False, 'reply_to': None, 'subject': None, 'content_type': 'text/plain', 'id': None, 'user_id': None, 'correlation_id': None, 'priority': 0, 'durable': False, 'ttl': 0, 'properties': {'c': False, 'color': 'red', 'spout-id': 'efefc259-f048-40b3-abf1-d9bff45eaf13:0'}, 'content': 'asdf'}

[2]
no message is fetched

[broker log]
2014-03-31 09:32:53 [Security] debug SASL: No Authentication Performed
2014-03-31 09:32:53 [Broker] debug LinkRegistry::notifyConnection(); key=qpid.127.0.0.1:5672-127.0.0.1:53478
2014-03-31 09:32:53 [Model] debug Create connection. user:anonymous rhost:qpid.127.0.0.1:5672-127.0.0.1:53478
2014-03-31 09:32:53 [Broker] debug anonymous.209b10e3-75cc-43dc-80d9-e69eff6f7e50: attached on broker.
2014-03-31 09:32:53 [Broker] debug anonymous.209b10e3-75cc-43dc-80d9-e69eff6f7e50: ready to send, activating output.
2014-03-31 09:32:53 [Broker] debug Selector parsed[c = false] into: (I:c=BOOL:false)
2014-03-31 09:32:53 [Model] debug Create subscription. queue:q destination:q user:anonymous rhost:qpid.127.0.0.1:5672-127.0.0.1:53478 exclusive:F
2014-03-31 09:32:53 [Broker] debug next() called for invalid cursor, index started at 0 (of 1)
2014-03-31 09:32:53 [Broker] debug in next(), cursor set to 1
2014-03-31 09:32:53 [Broker] debug in next(), returning message at 1
2014-03-31 09:32:53 [Broker] debug Selector identifier: c->STRING:'red'
2014-03-31 09:32:53 [Broker] debug Consumer doesn't want message from 'q'
2014-03-31 09:32:53 [Broker] debug next() called for cursor at 1, index set to 1 (of 1)
2014-03-31 09:32:53 [Broker] debug no message to return from next
2014-03-31 09:32:53 [Broker] debug No messages to dispatch on queue 'q'
2014-03-31 09:32:53 [Broker] debug next() called for cursor at 1, index set to 1 (of 1)
2014-03-31 09:32:53 [Broker] debug no message to return from next
2014-03-31 09:32:53 [Broker] debug No messages to dispatch on queue 'q'
2014-03-31 09:32:53 [Model] debug Delete subscription. destination:q user:anonymous rhost:qpid.127.0.0.1:5672-127.0.0.1:53478
2014-03-31 09:32:53 [Broker] debug anonymous.209b10e3-75cc-43dc-80d9-e69eff6f7e50: detached on broker.
2014-03-31 09:32:53 [Model] debug Delete connection. user:anonymous rhost:qpid.127.0.0.1:5672-127.0.0.1:53478

Expected results:
the prefix keys are identified separately
and above drain should read the message

Additional info:

Comment 1 Justin Ross 2014-03-31 10:48:09 UTC
Andrew, please assess.

Comment 3 Andrew Stitcher 2014-04-04 21:09:16 UTC
If I read this report correctly it seems like a serious bug:

As far as I can see from the log there are 2 properties:
c = False (boolean)
color = "red" (string)

and the selector is looking up c and returning "red"

Comment 4 Andrew Stitcher 2014-04-04 21:55:47 UTC
I cannot reproduce this behaviour with the trunk code. So maybe I backport of the current selector code will fix the problem.

Comment 7 Andrew Stitcher 2014-04-27 22:37:05 UTC
The underlying bug has now been fixed  on the upstream trunk for qpid in 
r1590505
(https://svn.apache.org/r1590505)

Comment 9 Zdenek Kraus 2014-05-21 11:14:48 UTC
tested on RHEL 6.5 i686 && x86_64 with following packages:

python-qpid-0.22-14.el6
qpid-proton-c-0.7-1.el6
qpid-cpp-server-devel-0.22-40.el6
qpid-cpp-server-ha-0.22-40.el6
qpid-jca-0.22-2.el6
qpid-cpp-server-0.22-40.el6
qpid-tools-0.22-12.el6
qpid-java-client-0.22-6.el6
qpid-qmf-debuginfo-0.22-31.el6
qpid-snmpd-debuginfo-1.0.0-16.el6
qpid-cpp-client-devel-docs-0.22-40.el6
qpid-cpp-client-0.22-40.el6
qpid-cpp-client-devel-0.22-40.el6
qpid-tests-0.22-15.el6
qpid-snmpd-1.0.0-16.el6
qpid-cpp-server-linearstore-0.22-40.el6
qpid-java-common-0.22-6.el6
qpid-java-example-0.22-6.el6
qpid-proton-debuginfo-0.7-1.el6
qpid-proton-c-devel-0.7-1.el6
python-qpid-qmf-0.22-31.el6
qpid-qmf-devel-0.22-31.el6
qpid-cpp-server-rdma-0.22-40.el6
qpid-cpp-server-xml-0.22-40.el6
qpid-jca-xarecovery-0.22-2.el6
perl-qpid-debuginfo-0.22-12.el6
qpid-qmf-0.22-31.el6
perl-qpid-0.22-12.el6
qpid-cpp-debuginfo-0.22-40.el6
qpid-cpp-client-rdma-0.22-40.el6
ruby-qpid-qmf-0.22-31.el6


works as expected.

Comment 10 errata-xmlrpc 2014-09-24 15:10:57 UTC
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.

http://rhn.redhat.com/errata/RHEA-2014-1296.html


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