Skip to content

fix(tools): stop accumulating retryQueueNums across masters in exportMetadata - #11135

Open
zjncs wants to merge 1 commit into
apache:developfrom
zjncs:fix/export-metadata-retry-queue-nums
Open

zjncs wants to merge 1 commit into
apache:developfrom
zjncs:fix/export-metadata-retry-queue-nums

Conversation

@zjncs

@zjncs zjncs commented Sep 11, 2026

Copy link
Copy Markdown

Motivation

mqadmin exportMetadata summed retryQueueNums of the same subscription group over every master of the cluster, the way topic queue numbers are totaled. But a subscription group config is cluster-wide: a group exported from an N-broker cluster came out with N times its real retryQueueNums, and re-importing that metadata inflated every group's retry queues.

Modifications

Keep the first seen config per group instead of summing, matching the cluster-wide semantics of subscription group config.

Verification

Fail-before (new test, run against the unpatched code):

ExportMetadataCommandTest#testSubscriptionGroupRetryQueueNumsNotAccumulatedAcrossBrokers
java.lang.AssertionError: retryQueueNums must not be summed across the two masters expected:<1> but was:<2>

Pass-after:

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 -- ExportMetadataCommandTest

…Metadata

exportMetadata summed retryQueueNums of the same subscription group over
every master of the cluster the way topic queue numbers are totaled, so a
group exported from an N-broker cluster came out with N times its real
retryQueueNums. Subscription group config is cluster-wide: keep the first
seen config instead of summing.
Copilot AI lite review requested due to automatic review settings September 11, 2026 07:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Correct fix — subscription group config is cluster-wide and should not be accumulated across brokers. The putIfAbsent approach is clean and the test with two broker mockers validates the fix.


Automated review by github-manager-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants