Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Optimize the message queue write selector used by proxy #8077

Open
1 task done
redlsz opened this issue Apr 30, 2024 · 0 comments · May be fixed by #8078
Open
1 task done

[Enhancement] Optimize the message queue write selector used by proxy #8077

redlsz opened this issue Apr 30, 2024 · 0 comments · May be fixed by #8078

Comments

@redlsz
Copy link
Contributor

redlsz commented Apr 30, 2024

Before Creating the Enhancement Request

  • I have confirmed that this should be classified as an enhancement rather than a bug/feature.

Summary

There may be certain issues with the org.apache.rocketmq.proxy.service.route.MessageQueueSelector when selecting write queue by filters.

  1. The intention of #selectOneMessageQueue is traversing each candidate queue until find eligible one, but this index can be increased concurrently by multiple threads. Therefore, in one traversal, some queues may be accessed more than one time, while some others may not be accessed.
image
  1. The #transferQueue2Addressable doesn't traverse brokerActingQueues. So if select by onlyBroker=true, the transferred result is always null.
image

Motivation

Make proxy MessageQueueSelector work as expected.

Describe the Solution You'd Like

  1. Add new MessageQueueReadSelector to extend MessageQueueSelector, using ThreadLocalIndex as write selector index.

  2. Remove unnecessary transferring between MessageQueue and AddressableMessageQueue.

Describe Alternatives You've Considered

/

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant