Skip to content

Conversation

@FaisalMisbah23
Copy link

Which Issue(s) This PR Fixes

Fixes #10030

Brief Description

Fix topic deletion issue in master-slave RocketMQ clusters. The problem was that slave brokers were deleting all topics during synchronization instead of only the missing ones. This was caused by deleteTopicConfig() and deleteSubscriptionGroupConfig() calls being placed outside the conditional checks in SlaveSynchronize.java.

How Did You Test This Change?

  • Verified code compiles successfully
  • Confirmed the fix only affects the conditional deletion logic
  • Created test framework to reproduce the issue

Issue: Topics cannot be permanently deleted in master-slave RocketMQ clusters
because slave brokers incorrectly delete all topics during synchronization.

Root Cause: In SlaveSynchronize.java, the deleteTopicConfig() call was placed
outside the conditional check, causing ALL topics to be deleted from slaves
during sync, not just the ones missing from master's config.

Fix: Move deleteTopicConfig() and deleteSubscriptionGroupConfig() calls inside
the conditional blocks so they only execute for topics/subscription groups that
should actually be deleted.

This addresses GitHub issue apache#10030 and is related to issue apache#9984.

Changes:
- syncTopicConfig(): Move topicConfigManager.deleteTopicConfig() inside if block
- syncSubscriptionGroupConfig(): Move subscriptionGroupManager.deleteSubscriptionGroupConfig() inside if block
@FaisalMisbah23 FaisalMisbah23 force-pushed the fix-topic-deletion-issue-10030 branch from 7d5ae9b to ddb971e Compare January 29, 2026 13:31
@Kris20030907
Copy link
Contributor

It seems that this PR duplicates this issue: #9996.

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.

The MQ master-slave cluster is unable to delete the topic.

2 participants