Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declaring a classic priority queue leads to strange "queue storage version" #9370

Closed
walro opened this issue Sep 12, 2023 · 1 comment · Fixed by #9384
Closed

Declaring a classic priority queue leads to strange "queue storage version" #9370

walro opened this issue Sep 12, 2023 · 1 comment · Fixed by #9384
Labels
Milestone

Comments

@walro
Copy link
Contributor

walro commented Sep 12, 2023

Describe the bug

Declaring a priority queue leads to weird values being presented in the management UI (and via rabbitmqadmin), see screenshots.

Here I would expect it to be 1 rather than 11:

Screenshot 2023-09-12 at 12 47 02

and here to be 2 rather than 22:

Screenshot 2023-09-12 at 12 48 27

Reproduction steps

  1. Create two queues:
    1. rabbitmqadmin declare queue name=priority-bug1 arguments='{"x-max-priority":10,"x-queue-version":1}'
    2. rabbitmqadmin declare queue name=priority-bug2 arguments='{"x-max-priority":10,"x-queue-version":2}'
  2. List the queues:
    1. rabbitmqadmin --vhost / list queues name backing_queue_status.version
  3. See the output not having the expected values:
+---------------+------------------------------+
|     name      | backing_queue_status.version |
+---------------+------------------------------+
| priority-bug1 | 11                           |
| priority-bug2 | 22                           |
+---------------+------------------------------+

It seems like the value becomes something like (1 + max_priority) * queue_version?

Expected behavior

To see versions correspond to the queue version number.

Additional context

Tried this on 3.12.4, but have observed on 3.12.1 too.

@walro walro added the bug label Sep 12, 2023
@michaelklishin
Copy link
Member

michaelklishin commented Sep 12, 2023

Every priority queue is N queues under the hood, so my guess is that the metric tries to aggregate version numbers as it would, say, counters like the number of messages in a certain state.

It should instead just pick the storage version of the first internal queue since they will never differ.

gomoripeti added a commit to cloudamqp/rabbitmq-server that referenced this issue Sep 12, 2023
@michaelklishin michaelklishin added this to the 3.12.5 milestone Sep 12, 2023
mergify bot pushed a commit that referenced this issue Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants