GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — [improve][broker] PIP-379: Key_Shared Draining Hashes for Improved Message Ordering by lhotari · Pull Request #23352 · apache/pulsar Conversation
|
| // deduplication for readMoreEntriesAsync calls | ||
| if (readMoreEntriesAsyncRequested.compareAndSet(false, true)) { | ||
| topic.getBrokerService().executor().execute(() -> { | ||
| readMoreEntriesAsyncRequested.set(false); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Hi, Lari, sorry to bother you, But when I read the source code, I'm confused about this:
readMoreEntriesAsyncRequested to "block" duplicate requeststopic.getBrokerService().executor() is a multi-threaded pool (has multiple core threads):could you explain how this work? I would be so much appreciate!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@3pacccccc The intention isn't to prevent concurrent execution. The short comment "deduplication for readMoreEntriesAsync calls" explains the intention. In Pulsar code, readMoreEntries and readMoreEntriesAsync is called in multiple locations to ensure that all entries that were made available in a way or another would get dispatched. That's why the deduplication makes sense since it will continue to provide that guarantee while reducing the extra overhead of unnecessary concurrent or subsequent calls to readMoreEntries.
Since in most (or all) dispatcher implementations the method "readMoreEntries" itself is a synchronous method, it will serialize the execution eventually. I agree that this isn't an optimal solution how this is handled in dispatchers, but changing it wasn't the intention when the deduplication was added in this PR.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@lhotari OK, I get it, thank you so much!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[Bug] key-SHARED subscription is not performing redelivery and going in infinite while loop of reading messages from disk and not dispatching any messages [Bug] Subscription consumption stuck on consumer reconnect [Bug] Broker dispatch messages despite a message with the same key is unack [Bug][broker] no mesage receive for som partition New KeyShared consumers will not get any messages until a consumer that did get messages disconnects or acks/nacks some messages
There was an error while loading. Please reload this page.