-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix][broker] Added the skipped message handler for ServiceUnitStateChannel #20677
Conversation
…nit state channel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change LGTM, but I think this is a temporary solution. We should refactor in the future.
The cleaner approach would be to expose |
…hannel (#20677) ### Motivation When topic lookups race(and the first lookup returns too fast before the second request gets deduped), the later lookup requests can timeout because the skipped messages are ignored at the table view and do not notify the service unit state channel. ex: m1: assign to b1 -> m2: owned by b1 -> m3: assign to b2 // m3 is skipped at the tableview When m3 is skipped, we better get the channel notified to return the lookup request with the current owner(b1) instead of letting the request time out. ### Modifications - Added the `handleSkippedMessage` and `setSkippedMsgHandler` in `TopicCompactionStrategy`. - `ServiceUnitStateChannel` registers `ServiceUnitStateChannel.handleSkippedEvent` to `ServiceUnitStateCompactionStrategy` by `setSkippedMsgHandler`. - TableView calls `TopicCompactionStrategy.handleSkippedMessage` when messages are skipped.
} | ||
|
||
|
||
static TopicCompactionStrategy load(String tag, String topicCompactionStrategyClassName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not cherry-pick this public API change to branch-3.0 @Technoboy-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This API should only use for extensible load managers. I added an annotation to mark this as private, #20858 , please help take a look at this PR.
Motivation
When topic lookups race(and the first lookup returns too fast before the second request gets deduped), the later lookup requests can timeout because the skipped messages are ignored at the table view and do not notify the service unit state channel.
ex:
m1: assign to b1 -> m2: owned by b1 -> m3: assign to b2 // m3 is skipped at the tableview
When m3 is skipped, we better get the channel notified to return the lookup request with the current owner(b1) instead of letting the request time out.
Modifications
handleSkippedMessage
andsetSkippedMsgHandler
inTopicCompactionStrategy
.ServiceUnitStateChannel
registersServiceUnitStateChannel.handleSkippedEvent
toServiceUnitStateCompactionStrategy
bysetSkippedMsgHandler
.TopicCompactionStrategy.handleSkippedMessage
when messages are skipped.Verifying this change
This change is already covered by existing tests, such as ServiceUnitStateChannelImpl.conflictAndCompactionTest
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: heesung-sn#48