Skip to content

[Bug] MQFaultStrategy will send to wrong broker even when it is not writable #7713

@leizhiyuan

Description

@leizhiyuan

Before Creating the Bug Report

  • I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Runtime platform environment

review

RocketMQ version

4.9.x

JDK Version

No response

Describe the Bug

MQFaultStrategy will send to wrong broker even when it is not writable

Steps to Reproduce

MQFaultStrategy will send to wrong broker even when it is not writable

What Did You Expect to See?

MQFaultStrategy will send to wrong broker even when it is not writable

What Did You See Instead?

MQFaultStrategy will send to wrong broker even when it is not writable

Additional Context

image
    public int getQueueIdByBroker(final String brokerName) {
        for (int i = 0; i < topicRouteData.getQueueDatas().size(); i++) {
            final QueueData queueData = this.topicRouteData.getQueueDatas().get(i);
            if (queueData.getBrokerName().equals(brokerName)) {
                return queueData.getWriteQueueNums();
            }
        }

        return -1;
    }

如果一个topic存在两个broker集群,其中一个broker集群通过perm设置了禁止写入,这里会绕过,并且这里会改变messagequeue,这样,由于外部的topicroute没有变化,这个状态后续无法更新了

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions