-
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] fix broker may lost rack information #23331
base: master
Are you sure you want to change the base?
Conversation
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.
LGTM. Thanks for the contribution @TakaHiR07
.thenAcceptAsync(bookies -> | ||
writableBookiesWatchers.forEach(w -> w.onBookiesChanged(bookies)), executor); |
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.
It would be useful to add a comment why all watchers are triggered when a new listener is added.
.thenAcceptAsync(bookies -> | ||
readOnlyBookiesWatchers.forEach(w -> w.onBookiesChanged(bookies)), executor); |
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.
It would be useful to add a comment why all watchers are triggered when a new listener is added.
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.
done
aa7fcdc
to
46ea59b
Compare
closing and reopening to trigger CI |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #23331 +/- ##
=============================================
- Coverage 73.57% 42.56% -31.02%
+ Complexity 32624 16836 -15788
=============================================
Files 1877 1812 -65
Lines 139502 154517 +15015
Branches 15299 18409 +3110
=============================================
- Hits 102638 65766 -36872
- Misses 28908 80868 +51960
+ Partials 7956 7883 -73
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Main Issue: #23330
Relevant issue: #23282, #23283
Motivation
Fix another issue cause broker lost rack information. There is a previous issue also cause broker lost rack information.
Modifications
This is the first potential fix, when construct bookieClient and do watchWritableBookies() to register listener, trigger each listener in writableBookiesWatchers.
This fix can ensure multiple listeners is trigger in a sync way, but it would bring duplicate trigger problem. Since watchWritableBookies() is only executed twice when bookieClient construct. I think the duplicate trigger problem is acceptable.
Alternative fix is to make BookieRackAffinityMapping#watchAvailableBookies become sync method. Change to registrationClient.watchWritableBookies(......).get() in BookieRackAffinityMapping#watchAvailableBookies. Now it is async.
Verifying this change
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: