Skip to content

Auto create topic question #566

@makabakaboom

Description

@makabakaboom

BUG REPORT

  1. 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

  1. Please tell us about your environment:

broker 4.3.0
client 4.3.0
3 namesrv 2 master 2 slave

  1. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions