Skip to content

[ISSUE #11613] Fix single-broker metadata export without filters - #11614

Merged
ShannonDing merged 1 commit into
apache:developfrom
liataynat:fix/export-metadata-single-broker
Nov 25, 2026
Merged

ShannonDing merged 1 commit into
apache:developfrom
liataynat:fix/export-metadata-single-broker

Conversation

@liataynat

Copy link
Copy Markdown
Contributor

Which Issue(s) This PR Fixes

Brief Description

When exportMetadata targets a single Broker and neither -t nor -g is specified, export both user topic and subscription group tables to metadata.json. Use the same top-level fields as cluster export.

How Did You Test This Change?

  • Reproduced the empty output directory with the actual mqadmin command against a local RocketMQ 5.5.1 NameServer and Broker.
  • Verified that the same command wrote metadata.json after the change. Its topic and subscription group tables matched the corresponding separate exports.
  • Rechecked the -t, -g, and cluster export paths.
  • Ran the new ExportMetadataCommandTest with JUnit 4.13.2. It failed on the unpatched command and passed with the patch.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 50.60%. Comparing base (74c2a8e) to head (cd35bbc).
⚠️ Report is 5 commits behind head on develop.

Files with missing lines Patch % Lines
...mq/tools/command/export/ExportMetadataCommand.java 90.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #11614      +/-   ##
=============================================
+ Coverage      50.47%   50.60%   +0.13%     
- Complexity     14711    14746      +35     
=============================================
  Files           1391     1391              
  Lines         103541   103559      +18     
  Branches       13575    13575              
=============================================
+ Hits           52261    52407     +146     
+ Misses         45042    44899     -143     
- Partials        6238     6253      +15     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ShannonDing
ShannonDing merged commit 9435652 into apache:develop Nov 25, 2026
10 checks passed
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.

[Bug] mqadmin exportMetadata exits without writing a file in broker-only mode

3 participants