Bug 619502

Summary: qpid-stat -q reports a given queue n times for an n node cluster
Product: Red Hat Enterprise MRG Reporter: Gordon Sim <gsim>
Component: qpid-qmfAssignee: Ken Giusti <kgiusti>
Status: CLOSED ERRATA QA Contact: Jan Sarenik <jsarenik>
Severity: medium Docs Contact:
Priority: medium    
Version: betaCC: jsarenik, tross
Target Milestone: 1.3   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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: 522039    
Bug Blocks:    
Attachments:
Description Flags
proposed fix none

Description Gordon Sim 2010-07-29 17:12:14 UTC
Description of problem:

qpid-stat -q reports a given queue n times for an n node cluster

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

qpid trunk r980198

How reproducible:

100%

Steps to Reproduce:
1. start n node cluster (where n > 1)
2. add a queue (e.g. qpid-config add queue my-queue)
3. qpid-stat -q
  
Actual results:

The created queue appears n times.

Expected results:

The created queue should really only appear once.

Comment 1 Ken Giusti 2010-07-30 00:34:14 UTC
It seems that qpid-stat is designed to act this way.

When qpid-stat connects to the target broker, it sends a query for the package "cluster", and, if present, it then queries for a list of cluster objects.  Using that list of cluster objects, it builds up a list of ip-address:port addresses for each broker in the cluster.  

It then sends a separate query to each of these brokers, which results in the duplicate entries.

It would be trivial to disable this behavior by default, and add a command line option if the old behavior is desired.

Comment 2 Ken Giusti 2010-07-30 02:04:53 UTC
Created attachment 435445 [details]
proposed fix

Changes the behavior of qpid-stat to ignore cluster configuration, unless the option "-C | --cluster" is supplied.

Comment 3 Gordon Sim 2010-07-30 07:18:00 UTC
Comment on attachment 435445 [details]
proposed fix

Looks good to me, and would lead to more intuitive behaviour by default without sacrificing the full (redundant) listing where desired. Ted, what do you think?

Comment 4 Ken Giusti 2010-07-30 12:45:32 UTC
Submitted above patch upstream: 

Committed revision 980766.

Comment 6 Jan Sarenik 2010-09-07 13:01:52 UTC
Verified on qpid-tools-0.7.946106-10.el5

# qpid-stat -q | awk '{print $1}' | sed 1,3d | sort | uniq -c
      1 my-queue
      1 qmfc-v2-hb-slanina.24315.1
      1 qmfc-v2-slanina.24315.1
      1 qmfc-v2-ui-slanina.24315.1
      1 reply-slanina.24315.1
      1 topic-slanina.24315.1

# qpid-stat -Cq | awk '{print $2}' | sed 1,3d | sort | uniq -c
      2 my-queue
      2 qmfc-v2-hb-slanina.24157.2
      1 qmfc-v2-hb-slanina.24157.3
      2 qmfc-v2-slanina.24157.2
      1 qmfc-v2-slanina.24157.3
      2 qmfc-v2-ui-slanina.24157.2
      1 qmfc-v2-ui-slanina.24157.3
      2 reply-slanina.24157.2
      1 reply-slanina.24157.3
      2 topic-slanina.24157.2
      1 topic-slanina.24157.3