-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Labels
Description
BUG REPORT
- Please describe the issue you observed:
- What did you do (The steps to reproduce)?
broker端开启了自动创建Topic,生产端默认配置,首先发送一条消息,超过30s后在发送消息,只会在一个master节点上面创建topic,不会再所有master节点上面创建topic
- What did you expect to see?
所有master节点都会自动创建topic
- What did you see instead?
只有一个master节点有topic
- Please tell us about your environment:
broker 4.3.0
client 4.3.0
3 namesrv 2 master 2 slave
-
Other information (e.g. detailed explanation, logs, related issues, suggestions how to fix, etc):
分析自动创建topic源码发现,client第一次发送会根据AUTO_CREATE_TOPIC_KEY从namesrv拿到topicRouteData作为新创建topic的topicRouteData,而MQClientInstance里面每30s会拉取topic的topicRouteData最新信息并更新。
异常情况1:Producer发送一条信息后关闭掉Producer,这个时候只有在一个broker上面有topic信息,下一次启动Producer发送消息的时候就会直接从NameSrv拿到最新的topicRouteData,这样就只能在一个master节点上面创建topic
异常情况2:Producer发送一条信息后,这个时候只有在一个broker上面有topic信息,隔35s在发送一条信息,在这段时间内,已经完成MQClientInstance对Topic Route的更新,topicRouteData只会拉取到一个master节点,这样也只能在一个master节点上面创建topic