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

[fix][broker] fix broker may lost rack information #23331

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TakaHiR07
Copy link
Contributor

@TakaHiR07 TakaHiR07 commented Sep 23, 2024

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

  • Make sure that the change passes the CI checks.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

Copy link
Member

@lhotari lhotari left a 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

Comment on lines +185 to +190
.thenAcceptAsync(bookies ->
writableBookiesWatchers.forEach(w -> w.onBookiesChanged(bookies)), executor);
Copy link
Member

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.

Comment on lines +198 to +207
.thenAcceptAsync(bookies ->
readOnlyBookiesWatchers.forEach(w -> w.onBookiesChanged(bookies)), executor);
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@lhotari lhotari added the release/blocker Indicate the PR or issue that should block the release until it gets resolved label Sep 23, 2024
@lhotari
Copy link
Member

lhotari commented Oct 11, 2024

closing and reopening to trigger CI

@lhotari lhotari closed this Oct 11, 2024
@lhotari lhotari reopened this Oct 11, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.56%. Comparing base (bbc6224) to head (46ea59b).
Report is 667 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@              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     
Flag Coverage Δ
inttests 29.42% <100.00%> (+4.84%) ⬆️
systests 25.67% <100.00%> (+1.35%) ⬆️
unittests 38.45% <100.00%> (-34.40%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../metadata/bookkeeper/PulsarRegistrationClient.java 62.98% <100.00%> (-19.91%) ⬇️

... and 1563 files with indirect coverage changes

@lhotari lhotari removed this from the 4.0.0 milestone Oct 11, 2024
@lhotari lhotari added this to the 4.1.0 milestone Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs ready-to-test release/blocker Indicate the PR or issue that should block the release until it gets resolved release/3.0.8 release/3.3.3 release/4.0.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants