apache / apache/rocketmq

[Bug] auto delete topics when in Master-Slave Automatic Failover Mode

Open
#9,984 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
22.6k
Forks
12k
Avg merge
2d 20h
Merged PRs (30d)
26

Description

### Before Creating the Bug Report

- [x] I found a bug, not just asking a question, which should be created in [GitHub Discussions](https://github.com/apache/rocketmq/discussions).

- [x] I have searched the [GitHub Issues](https://github.com/apache/rocketmq/issues) and [GitHub Discussions](https://github.com/apache/rocketmq/discussions) of this repository and believe that this is not a duplicate.

- [x] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

### Runtime platform environment

OS: Alibaba Cloud Linux release 3 (OpenAnolis Edition).
2C8G
1 master 2 slave

### RocketMQ version

rocketmq-all-5.3.4

### JDK Version

_No response_

### Describe the Bug

In 5.3.4, using Master-Slave Automatic Failover Mode, I have 1 master and 2 slave, I find rocketmq broker delete topics automatically. Here is my monitor graph below:

Image

The broker log writes:
2026-01-05 14:59:21 INFO BrokerControllerScheduledThread1 - delete topic config OK, topic: TopicConfig [topicName=OFFSET_MOVED_EVENT, readQueueNums=1, writeQueueNums=1, perm=RW-, topicFilterType=SINGLE_TAG, topicSysFlag=0, order=false, attributes={}]

Is this a expected behavior?How can I know if the delete behavior will not cause error?And how can I know if there is an error when syncing topics?

### Steps to Reproduce

I deploy 3 nameserver, and the configs are the same, as below:
```
#Namesrv config
listenPort = 9876
enableControllerInNamesrv = true

#controller config
controllerDLegerGroup = sg
controllerDLegerPeers = n0-10.0.3.82:9878;n1-10.1.2.219:9878;n2-10.1.1.249:9878
controllerDLegerSelfId = n0
metricsExporterType = PROM
metricsPromExporterPort = 5558
metricsPromExporterHost = 0.0.0.0
```

also deploy 3 brokers , the confgs are same as below:
```
brokerClusterName = sg
brokerName = broker-a
brokerId = -1
deleteWhen = 04
fileReservedTime = 48
brokerRole = SLAVE
namesrvAddr = 10.0.3.82:9876;10.1.2.219:9876;10.1.1.249:9876
enableControllerMode = true
controllerAddr = 10.0.3.82:9878;10.1.2.219:9878;10.1.1.249:9878
allAckInSyncStateSet = true
listenPort = 30911
abortFile = /data/rocketmq/store/abort
storePathRootDir = /data/rocketmq/store
storePathCommitLog = /data/rocketmq/store/commitlog
storePathConsumeQueue = /data/rocketmq/store/consumequeue
storePathIndex = /data/rocketmq/store/index
storeCheckpoint = /data/rocketmq/store/checkpoint
autoCreateTopicEnable = true
enablePropertyFilter = true
messageDelayLevel=1s 5s 10s 30s 1m 2m 3m 4m 5m 6m 7m 8m 9m 10m 20m 30m 1h 2h 6h 12h 1d
metricsExporterType = PROM
metricsPromExporterPort = 5557
metricsPromExporterHost = 0.0.0.0
```

### What Did You Expect to See?

topics are not deleted automatically

### What Did You See Instead?

delete topics automatically, unexpectedly and unregularly

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the three-name-server, three-broker Master-Slave Automatic Failover setup with the configuration shown and inspect broker logs around deletion of OFFSET_MOVED_EVENT. Determine whether the deletion is expected during topic synchronization and how synchronization failures are reported; done means the behavior is explained or corrected and error detection is documented or covered by the relevant project tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.