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 — [fix][meta] Reload the bookie info on a cache miss in PulsarRegistrationClient by merlimat · Pull Request #27052 · apache/pulsar Conversation
Contributor
Fixes #23020 MotivationProblem. Example. Bookie
Versioned<BookieServiceInfo> info; if ((info = writableBookieInfo.get(bookieId)) == null) { info = readOnlyBookieInfo.get(bookieId); } if (info != null) { return completedFuture(info); } else { return FutureUtils.exception(new BKException.BKBookieHandleNotAvailableException()); } ModificationsChange. On a miss, } else { // The bookie can be registered and still missing here, if reading its info failed when it // registered. Reload it in background, without waiting, so that a retry can find it. readBookieInfoAsWritableBookie(bookieId) .thenCompose(writable -> writable.isPresent() ? completedFuture(writable) : readBookieInfoAsReadonlyBookie(bookieId)) .exceptionally(ex -> { log.debug().attr("bookieId", bookieId).exceptionMessage(ex) .log("Failed to reload the bookie info"); return null; }); return FutureUtils.exception(new BKException.BKBookieHandleNotAvailableException()); } For a bookie that is really down, the reload hits the negative entry already in the metadata cache, so it doesn't add load on the metadata store. Concurrent misses share one in-flight load in the cache. Verifying this changeAdded
It fails on master and passes with the fix (5 reruns). The whole Does this pull request potentially affect one of the following parts:If the box was checked, please highlight the changes
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…ionClient If reading the info of a newly registered bookie fails, the bookie stays missing from the registration client cache until another bookie change or a metadata session event, and the broker can't resolve it. Reload the info in background on a miss in getBookieServiceInfo, so that a retry finds it.
2 of 15 tasks
codelipenghui
approved these changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM. Failing fast on a miss and reloading in the background is the right approach. I ran the new test locally: it passes for both the writable and read-only cases. With the reload block removed, the writable case times out with Non-blocking, for a possible follow-up: when the registration-time read fails,
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page.
This was referenced
poorbarcode
pushed a commit
to poorbarcode/pulsar
that referenced
this pull request
…ionClient (apache#27052) (cherry picked from commit fa55275)
poorbarcode
pushed a commit
to poorbarcode/pulsar
that referenced
this pull request
…ionClient (apache#27052) (cherry picked from commit fa55275)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabelsProjectsDevelopmentSuccessfully merging this pull request may close these issues. [Bug][broker]PulsarRegistrationClient writableBookieInfo cache and readOnlyBookieInfo cache update fail causing broker to misjudge that the bookie is unavailable.Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |