Skip to content

[ISSUE #6275]🚀Implement RemoveColdDataFlowCtrGroupConfig command in rocketmq-admin-core#6348

Merged
mxsm merged 1 commit intomxsm:mainfrom
WaterWhisperer:feat-6275
Feb 16, 2026
Merged

[ISSUE #6275]🚀Implement RemoveColdDataFlowCtrGroupConfig command in rocketmq-admin-core#6348
mxsm merged 1 commit intomxsm:mainfrom
WaterWhisperer:feat-6275

Conversation

@WaterWhisperer
Copy link
Contributor

@WaterWhisperer WaterWhisperer commented Feb 16, 2026

Which Issue(s) This PR Fixes(Closes)

Brief Description

How Did You Test This Change?

Summary by CodeRabbit

  • New Features
    • Introduced a new broker command for removing consumer groups from cold data flow control configuration, supporting both individual broker and cluster-wide targeting with comprehensive validation and error handling.

@rocketmq-rust-bot
Copy link
Collaborator

🔊@WaterWhisperer 🚀Thanks for your contribution🎉!

💡CodeRabbit(AI) will review your code first🔥!

Note

🚨The code review suggestions from CodeRabbit are to be used as a reference only, and the PR submitter can decide whether to make changes based on their own judgment. Ultimately, the project management personnel will conduct the final code review💥.

@rocketmq-rust-robot rocketmq-rust-robot added Difficulty level/Moderate Moderate difficult ISSUE feature🚀 Suggest an idea for this project. labels Feb 16, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

Walkthrough

The pull request introduces a new RemoveColdDataFlowCtrGroupConfig command to rocketmq-admin-core. The implementation spans three files: command registry updates, broker command enumeration and dispatch, and a new sub-command module handling cold data flow control configuration removal for consumer groups across brokers or clusters.

Changes

Cohort / File(s) Summary
Command Registry
commands.rs, broker_commands.rs
Registers new broker command in classification table and adds enum variant with Clap attributes. Includes command dispatch mapping to execute the sub-command.
Sub-Command Implementation
remove_cold_data_flow_ctr_group_config_sub_command.rs
New module implementing RemoveColdDataFlowCtrGroupConfigSubCommand with CLI argument parsing, input validation, MQAdminExt lifecycle management, and removal logic for both single-broker and cluster-wide removal scenarios with error propagation.

Sequence Diagram

sequenceDiagram
    actor User as User/CLI
    participant Cmd as RemoveColdDataFlowCtrGroupConfigSubCommand
    participant Admin as MQAdminExt
    participant Broker as Broker(s)
    
    User->>Cmd: Execute with brokerAddr/clusterName + consumerGroup
    Cmd->>Cmd: Validate inputs (exactly one target, non-empty group)
    Cmd->>Admin: Initialize & set instance name
    Admin->>Admin: Start
    
    alt Target is Broker
        Cmd->>Admin: removeColdDataFlowCtrGroupConfig(brokerAddr, group)
        Admin->>Broker: RPC request
        Broker-->>Admin: Success/Error response
        Admin-->>Cmd: Result
    else Target is Cluster
        Cmd->>Admin: Fetch broker addresses for cluster
        Admin-->>Cmd: List of brokers
        loop For each broker
            Cmd->>Admin: removeColdDataFlowCtrGroupConfig(brokerAddr, group)
            Admin->>Broker: RPC request
            Broker-->>Admin: Success/Error response
            Admin-->>Cmd: Result (collect failures)
        end
    end
    
    Cmd->>Admin: Shutdown
    Admin-->>Cmd: Closed
    Cmd-->>User: Return result with error context
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 With whiskers twitching, cold data flows,
A command hops through broker rows!
Configuration brushed clean and bright,
Consumer groups freed from control's tight grip—
Cold data management takes its hop! ✨🌟

🚥 Pre-merge checks | ✅ 3 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The implementation adds the RemoveColdDataFlowCtrGroupConfig command with single broker/cluster target support, but lacks batch removal for multiple groups and active configuration validation features. Add batch removal support for multiple consumer groups and implement validation to prevent accidental removal of active configurations as specified in issue #6275.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (4 files):

⚔️ rocketmq-broker/src/processor/end_transaction_processor.rs (content)
⚔️ rocketmq-store/src/queue.rs (content)
⚔️ rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands.rs (content)
⚔️ rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker_commands.rs (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: implementing a RemoveColdDataFlowCtrGroupConfig command in rocketmq-admin-core, matching the changeset.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the RemoveColdDataFlowCtrGroupConfig command; no out-of-scope modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch feat-6275
  • Post resolved changes as copyable diffs in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In
`@rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker_commands/remove_cold_data_flow_ctr_group_config_sub_command.rs`:
- Around line 37-41: The help texts for the CLI args in the remove cold-data
flow config command are wrong (they say "update" instead of "remove"); update
the #[arg(..., help = "...")] for the fields broker_addr and cluster_name in
remove_cold_data_flow_ctr_group_config_sub_command.rs to use phrasing like
"remove which broker" and "remove which cluster" respectively so the help output
matches the command's intent.
- Around line 164-167: The error message in the Err branch for
RemoveColdDataFlowCtrGroupConfigSubCommand is formatting the error `e` into the
slot meant for the cluster name; update the RocketMQError::Internal message to
include both the cluster name variable (e.g., cluster_name) and the error `e` so
it reads like "Failed to fetch broker addresses for cluster {cluster_name}:
{error}". Locate the Err(e) branch that constructs RocketMQError::Internal and
change the format string and arguments to pass the cluster name first and `e`
second.
🧹 Nitpick comments (2)
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker_commands/remove_cold_data_flow_ctr_group_config_sub_command.rs (2)

151-160: Avoid unnecessary .clone() — use .into_iter() instead of .iter().

join_all returns an owned Vec, so you can consume it with into_iter() and avoid cloning every Result.

Proposed fix
                 .await
-                .iter()
-                .filter_map(|result| result.clone().err())
+                .into_iter()
+                .filter_map(|result| result.err())
                 .collect();

1-1: Copyright year is 2023 but other new files in this repo (e.g. broker_commands.rs) use 2026.

Align with the project's current convention.

@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 0% with 95 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.39%. Comparing base (db04a6a) to head (e5575d9).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...ove_cold_data_flow_ctr_group_config_sub_command.rs 0.00% 89 Missing ⚠️
...rocketmq-admin/rocketmq-admin-core/src/commands.rs 0.00% 5 Missing ⚠️
...ocketmq-admin-core/src/commands/broker_commands.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6348      +/-   ##
==========================================
- Coverage   42.42%   42.39%   -0.04%     
==========================================
  Files         918      919       +1     
  Lines      129040   129135      +95     
==========================================
- Hits        54750    54749       -1     
- Misses      74290    74386      +96     

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@rocketmq-rust-bot rocketmq-rust-bot left a comment

Choose a reason for hiding this comment

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

LGTM - All CI checks passed ✅

Copy link
Owner

@mxsm mxsm left a comment

Choose a reason for hiding this comment

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

LGTM

@mxsm mxsm merged commit f166e70 into mxsm:main Feb 16, 2026
10 of 24 checks passed
@rocketmq-rust-bot rocketmq-rust-bot added approved PR has approved and removed ready to review waiting-review waiting review this PR labels Feb 16, 2026
@WaterWhisperer WaterWhisperer deleted the feat-6275 branch February 16, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI review first Ai review pr first approved PR has approved auto merge Difficulty level/Moderate Moderate difficult ISSUE feature🚀 Suggest an idea for this project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature🚀] Implement RemoveColdDataFlowCtrGroupConfig command in rocketmq-admin-core

4 participants