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][broker] Revalidate ownership before retrying a fenced topic load by codelipenghui · Pull Request #27753 · apache/pulsar Conversation
Contributor
Motivation#27285 makes a broker validate its namespace lock authoritatively before it reloads a topic whose managed ledger was fenced, but only once the topic has finished loading. Two partial loads still leave no gate, so the retry trusts the cached ownership and can recover the new owner's ledger. Both were found in the review of #27285:
Modifications
Verifying this change
New
Does this pull request potentially affect one of the following parts:
Documentation
🤖 Generated with Claude Code
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsA topic load that failed partway because another broker opened the topic's managed ledger left no readmission gate, so the retry trusted the cached namespace ownership and could recover the new owner's ledger: - the managed-ledger open lost its metadata update to another writer (BadVersionException), or - an initialization step, such as opening the compaction or deduplication cursor, observed a fence. Install the gate while the failed load is still cached: in the managed-ledger open and initialization failure handlers when the failure is a fence or a managed-ledger metadata version conflict, and in the fence handlers of a topic that is still loading, whose close() removes the pending load. Other load failures keep using the cached ownership. Assisted-by: Claude Code (Opus 5.5)
codelipenghui
marked this pull request as ready for review
nodece
approved these changes
Member
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. Verified independently, with each new test pinned to the mechanism that covers it:
The direction of the guard is also safe against false positives: a gate only forces a fresh ownership check on the next readmission, which is cheap when the ownership is in fact still valid.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
lhotari
reviewed
Member
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. Thanks for closing these two remaining gaps from #27285. The gate now covers both partial-load paths. The change looks correct. A I have two small suggestions inline. One is to harden the replicator cursor path. The other is about log and comment wording that no longer matches the new callers.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
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. [QUALITY] A fence on a replicator cursor during the load can be hidden by another replicator's failure This handler only sees the aggregated initialization error. The replication step builds that error from Scenario: a topic replicates to two remote clusters. The first replicator's cursor opens, but The window is narrow, because once the ledger is fenced every later cursor open fails right away. Still, the fix is cheap, and the new @Override public void openCursorFailed(ManagedLedgerException exception, Object ctx) { if (exception instanceof ManagedLedgerFencedException) { brokerService.requireFreshOwnershipBeforeTopicReadmission(PersistentTopic.this); } future.completeExceptionally(new PersistenceException(exception)); } This can also be a follow-up.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
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. [QUALITY] The log and comments still describe only a fenced, loaded topic Nit: The
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page. AssigneesLabels
ready-to-test
release/4.0.15
release/4.2.6
release/5.0.2
type/bug
ProjectsDevelopmentSuccessfully merging this pull request may close these issues. 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. |