Skip to content

[fix][ml] Refresh cached cursor properties when a property write's response is lost - #27757

Open
nodece wants to merge 1 commit into
apache:masterfrom
nodece:fix-cursor-properties-refresh-after-metadata-error
Open

nodece wants to merge 1 commit into
apache:masterfrom
nodece:fix-cursor-properties-refresh-after-metadata-error

Conversation

@nodece

@nodece nodece commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Motivation

ManagedCursorImpl#computeCursorProperties refreshed the cached properties and version only in operationComplete. On operationFailed the cache kept the pre-write state, which is wrong in both failure classes:

  • after a version conflict it did not reflect the writer that committed first, so a retry kept using the stale version until something else refreshed it;
  • after a failure that lost the response of a committed write (a metadata timeout or a connection loss after the commit) it still claimed the write had not landed.

The second case was found in the review of #27673: the delayed-delivery snapshot reclaim checks the cached cursor property to decide whether a replacement ledger was published, concluded it was not, and deleted the ledger the durable property pointed at; after a reload the bucket's delayed index could only be rebuilt from the log. resolveBucketIdForDelete made the same decision from the same cache on the clear() path.

Modifications

  • On any failure of a durable property write, the cursor re-reads its info from the store (asyncGetCursorInfo) before completing the future.
  • While this broker still owns the ledger (through mlOwnershipChecker when present) and the cursor is not closed, it adopts the stored properties and version through updateCursorLedgerStat, so a retry sees the current state. The adoption never goes back from a version a concurrent write or refresh has already moved past.
  • When the stored record carries this attempt's publication id (the id MetaStoreImpl stamps on every cursor-info write), the write was committed and the call completes successfully, as reconcileCursorLedgerPublication does for the cursor ledger publication. A retrying caller therefore no longer double-applies the function on top of its own write.
  • On a ledger without an ownership checker (embedded use, tests), only that own committed write is adopted, never another writer's version, and not once the cursor is closed — the same fence the close path, reconcileCursorLedgerPublication and resolveCursorNodeIdentity keep. A version conflict on such a ledger is not refreshed.
  • The success callback of the write itself applies the same version-aware adoption: a delayed success reply that arrives after a conflict refresh or a later write has already moved the cache past this write's version is reported as success without rolling the cache back to the older snapshot.
  • Every adoption — the failure refresh and the success callback — goes through one shared helper whose version check and cache publication run in a single critical section, so a conflict refresh completing an asynchronous ownership check on another thread cannot install a newer snapshot between the check and the publication. Retained-ledger cleanup and the completion of the future stay outside the lock.
  • Every branch that actually adopts a record reclaims the retained cursor ledgers the adopted record proves unreferenced, so a broker restart before the next metadata update cannot leave them orphaned.
  • The refresh is best effort: if the ownership check or the re-read fails, or the write commits after the re-read was served, the cache keeps the pre-write state and the caller sees the original error. A caller deciding from getCursorProperties() after a failure treats the outcome as unknown.
  • Javadoc of updateCursorProperties updated accordingly.

Complements #27746: that PR makes every durable update a version-checked write; this one makes the cached snapshot truthful after the write fails, so the BadVersionException it surfaces to a retrying caller converges on the current state.

Verifying this change

  • Make sure that the change passes the CI checks.

Added to ManagedCursorUpdatePropertiesTest (each reads getCursorProperties() inside handle on the returned future, so the refresh is proven to precede the completion):

  • testCursorPropertiesRefreshFromStoreOnVersionConflict: a ledger with an ownership checker; another factory's cursor commits first, the local write fails with BadVersionException, and the cached properties already show the stored value.
  • testCursorPropertiesRefreshFromStoreWhenCommitResponseIsLost: the store commits the write and its response is lost (the lost-put-response injection [fix][ml] Reconcile cursor ledger publication after metadata errors #27385 uses); the call completes successfully and the cache shows the committed value.
  • testCursorPropertiesDoNotAdoptAnotherWriterWithoutOwnershipChecker: without a checker, a conflict on another writer's version is not adopted.
  • testCursorPropertiesStayUnchangedWhenOwnershipIsLost / testCursorPropertiesStayUnchangedWhenOwnershipCheckFails: the ownership gate.
  • testCursorPropertiesRefreshFailureFailsWithOriginalError: a failed re-read fails the call with the original error and leaves the cache unchanged.
  • testCursorPropertiesRefreshKeepsNewerLocalVersion: the not-older guard keeps a newer local version.
  • testDelayedSuccessReplyKeepsTheNewerSnapshot: the first write commits but its reply is held; the conflict refresh adopts {k=first}, a later write moves the cache to {k=third}, and releasing the delayed reply reports success without rolling the cache back.
  • testDelayedSuccessReplyConcurrentWithRefreshKeepsTheNewestSnapshot: the delayed reply, the refresh's ownership check and a later write are released concurrently, and the cached properties must equal the durable record; with the check and the publication split (and the gap widened), the test fails with the cache rolled back.
  • testRefreshAdoptionReclaimsRetainedCursorLedgers: a publication times out and its candidate is retained; a property write commits without referencing it while its reply is held; a conflicting update commits a newer record and the cursor's next write adopts it — the retained ledger is reclaimed and the too-old delayed reply claims nothing back.
  • testCursorPropertiesSkipAdoptionWithoutCheckerAfterClose: without a checker, the refresh recognizes the cursor's own committed write but the cursor has closed by the time the re-read is served; the cache stays as it was and the call still reports success.

Each guard was verified by an isolated revert turning its test red. The class (24) and ManagedCursorPropertiesTest (6) pass.

Does this pull request potentially affect one of the following parts:

Check the boxes that apply

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

@nodece
nodece force-pushed the fix-cursor-properties-refresh-after-metadata-error branch 2 times, most recently from ec845a6 to 305b000 Compare November 26, 2026 11:42

@lhotari lhotari left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for following up on the cache problem found in #27673; making the cached snapshot match the store after a failed write is the right direction.

I ran ManagedCursorUpdatePropertiesTest (15/15) and ManagedCursorPropertiesTest (6/6) at this head. Both new tests fail with the previous ManagedCursorImpl, so they do cover the change. Another plus: with a real ownership checker, the BadVersionException retries in ImmutableBucket.putBucketKeyId and removeBucketCursorProperty can now converge instead of reusing the stale version.

I have three points, details inline:

  • Without an ownership checker, the refresh now adopts a version written by another writer. The close path and reconcileCursorLedgerPublication avoid that. The ownership check also runs before the read rather than after it.
  • The refresh is best effort, so after an ambiguous failure the cache is still not authoritative. And when the re-read shows the attempted write committed, the call still fails, so a retry re-applies the function on top of its own write. I suggest completing successfully in that case and describing the rest as best effort.
  • Test gaps: no test passes an ownership checker or covers a failed re-read, and the lost-response test does not prove that the cache is updated before the future fails.

@codelipenghui codelipenghui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I reproduced both ownership cases at this head: without a checker, the second write succeeded after the conflict; when ownership changed during the metadata read, the old cursor still adopted the other writer’s value. In a local patch, I limited refresh to version conflicts and checked ownership after the read, before adopting the map and version together. Both regressions passed with the patch, and both cursor-property test classes passed (23 tests).

The lost-response test also confirmed that a failed write can have committed while the cache still shows the old value. I’d handle that separately in #27673: both immediate reclaim and 'clear()' should retain the snapshot unless publication is ruled out, including a possible late commit. Those cleanup paths aren’t on this head, so I didn’t patch or test them here.

@nodece
nodece force-pushed the fix-cursor-properties-refresh-after-metadata-error branch from 305b000 to 1b68ff3 Compare November 27, 2026 02:39
@nodece
nodece requested a review from lhotari November 27, 2026 02:39
@nodece
nodece force-pushed the fix-cursor-properties-refresh-after-metadata-error branch 2 times, most recently from 7c4b088 to 05d7ca4 Compare November 27, 2026 10:28

@codelipenghui codelipenghui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The rebased head addresses the earlier ownership concerns: it checks ownership after the read, refuses to adopt another writer’s state without a checker, and recognizes its own committed write by publication ID. All 26 existing cursor-property tests passed. A focused fault-injection test exposed one remaining ordering bug: a delayed success reply can roll back the cache after a conflict refresh lets a newer write succeed.

Comment on lines +467 to +475
private void adoptRefreshedCursorInfo(ManagedCursorInfo cursorInfo, Stat stat) {
synchronized (cursorPropertiesLock) {
Stat localStat = this.cursorLedgerStat;
// Don't go back from a version a concurrent write or refresh has moved past.
boolean notOlder = localStat == null
|| localStat.getCreationTimestamp() != stat.getCreationTimestamp()
|| localStat.getVersion() <= stat.getVersion();
if (notOlder) {
updateCursorLedgerStat(cursorInfo, stat);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Prevent a delayed success reply from rolling back the cursor cache

A property write commits at version V+1 but its success reply is delayed. A concurrent update conflicts and the new failure path refreshes the cache to V+1. Another update then commits and completes at V+2 before the delayed V+1 reply arrives. The late reply rolls the cached properties and version back to V+1. Readers can see the old value even after the newer update succeeded, and the next write can fail with an avoidable version conflict. The durable record remained at V+2 in the test.

The new refresh helper checks the version before adoption, but the property-write success callback still calls 'updateCursorLedgerStat' unconditionally. The focused test held only the first write’s successful response, waited for the conflict refresh and the second successful write, then released the response. The durable read returned 'k=second', but 'getCursorProperties()' returned 'k=first'.

Use an atomic, version-aware cache adoption check for both successful property replies and failure refreshes. If a successful reply is older than the local snapshot, complete that write successfully without replacing the cache. Add a regression that releases the first success reply after the newer write completes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 7be4962: the success callback now applies the same version-aware adoption as the refresh helper. When the reply's stat is in the same z-node generation and older than the cached version, the call completes successfully without replacing the snapshot; otherwise updateCursorLedgerStat runs as before.

testDelayedSuccessReplyKeepsTheNewerSnapshot reproduces the ordering: the first write commits but its reply is held, the conflicting update refreshes the cache to {k=first}, a later write moves the cache to {k=third}, and only then the delayed reply is released. The test reads the cache inside the completion callback and also checks the durable record: both stay at {k=third}, and the held write still reports success. With the guard removed the test fails with the cache rolled back to {k=first}.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Rebased on current master — the fixes referenced above are unchanged in 9028fb7 (the pre-rebase commit 7be4962 is no longer reachable). All 22 tests in ManagedCursorUpdatePropertiesTest pass on the rebased head.

@lhotari lhotari left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks for working through all three points.

  • The refresh now reads first and checks ownership after. Without an ownership checker it adopts only the cursor's own committed write, recognized by the publication ID that MetaStoreImpl.asyncUpdateCursorInfo stamps on copy (MetaStoreImpl.java:276).
  • When the re-read finds that own write committed, the call completes successfully. The updateCursorProperties Javadoc now describes the refresh as best effort and says the outcome is unknown after a failure.
  • New tests cover a checker that returns false, a checker that fails, a failed re-read, the not-older guard, and foreign-write adoption without a checker. Each test reads the cache inside handle, so the tests also prove the cache is updated before the future completes.

One small nit inline: the no-checker branch has no !state.isClosed() guard, unlike the checker branch.

// Without a checker, adopt only this cursor's own write, never
// another writer's version.
if (ownWrite) {
adoptRefreshedCursorInfo(current, stat);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[NIT] the no-checker branch adopts its own write without the !state.isClosed() guard the checker branch has

[NIT] No closed-state guard on this branch

The checker branch adopts only when !state.isClosed() (ManagedCursorImpl.java:633). This branch adopts the cursor's own write even after the cursor has closed. The reply on the earlier thread says adoption is skipped once the cursor is closed. That holds for the checker path only.

Adopting your own committed write after close is probably harmless. Still, updateCursorLedgerStat also runs deleteUnreferencedRetainedCursorLedgers, and that is easier to reason about when both branches behave the same. Suggestion: guard the adoption here with !state.isClosed() and still complete successfully, because the write did commit.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 7be4962: the no-checker branch now guards adoption with !state.isClosed() and still completes successfully, since the write did commit — matching the checker branch.

testCursorPropertiesSkipAdoptionWithoutCheckerAfterClose covers it: the write commits but its response is lost, the conflict's re-read is held until the cursor has closed, and the cache stays as it was while the call reports success. Without the guard the test fails with the committed snapshot adopted after close.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Rebased on current master — the fixes referenced above are unchanged in 9028fb7 (the pre-rebase commit 7be4962 is no longer reachable). All 22 tests in ManagedCursorUpdatePropertiesTest pass on the rebased head.

@codelipenghui codelipenghui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Recommendation unchanged at 05d7ca4. The earlier ownership concerns are resolved: the refresh checks ownership after reading and, without a checker, adopts only its own confirmed write. The new approval agrees on those fixes and makes no direct request for a reply. It does not address the reproduced cache rollback from a delayed success reply, and the implementation is unchanged.

Comment on lines +467 to +475
private void adoptRefreshedCursorInfo(ManagedCursorInfo cursorInfo, Stat stat) {
synchronized (cursorPropertiesLock) {
Stat localStat = this.cursorLedgerStat;
// Don't go back from a version a concurrent write or refresh has moved past.
boolean notOlder = localStat == null
|| localStat.getCreationTimestamp() != stat.getCreationTimestamp()
|| localStat.getVersion() <= stat.getVersion();
if (notOlder) {
updateCursorLedgerStat(cursorInfo, stat);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Prevent a delayed success reply from rolling back the cursor cache

A write commits at V+1 but its success reply is delayed. A conflicting update refreshes the cache to V+1, and a subsequent write completes at V+2 before the V+1 reply arrives. The late reply restores the older cached properties and version. Readers can see stale properties after a successful update, and the next write can hit an avoidable version conflict. The durable record remained correct in the reproduction.

At the unchanged head, adoption via the refresh helper is version-guarded, but the write-success callback at line 600 still updates the cache unconditionally. In the prior run’s fault-injection test on this SHA, a durable read returned 'k=second' while the cache reverted to 'k=first' after the first reply was released. The new comments discuss refresh ordering, not this success callback.

Apply the same atomic version-aware adoption rule to successful property-write responses and refreshes. If a successful response is older than the cache, report success without replacing the snapshot. Add the delayed-success regression.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 9028fb7 (rebased on current master): the success callback now applies the same version-aware adoption as the refresh helper. When the reply's stat is in the same z-node generation and older than the cached version, the call completes successfully without replacing the snapshot; otherwise updateCursorLedgerStat runs as before.

testDelayedSuccessReplyKeepsTheNewerSnapshot reproduces the ordering: the first write commits but its reply is held, the conflicting update refreshes the cache to {k=first}, a later write moves the cache to {k=third}, and only then the delayed reply is released. The cache (read inside the completion callback) and the durable record both stay at {k=third}, and the held write still reports success. With the guard removed the test fails with the cache rolled back to {k=first}.

@nodece
nodece force-pushed the fix-cursor-properties-refresh-after-metadata-error branch 2 times, most recently from 7be4962 to 9028fb7 Compare November 30, 2026 03:56

@codelipenghui codelipenghui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The new head fixes the original delayed-reply test case and the no-checker close case; all 28 focused tests passed. One narrower rollback race remains: the success callback releases the lock between checking the cached version and updating it. A controlled interleaving reproduced the rollback when a conflict refresh advanced the cache in that gap.

Comment on lines 600 to 612
synchronized (cursorPropertiesLock) {
Stat localStat = ManagedCursorImpl.this.cursorLedgerStat;
// A delayed success reply can arrive after a conflict refresh or a later
// write has already moved the cache past this write's version. Keep the
// newer snapshot and still report success, because the write did commit.
if (localStat != null
&& localStat.getCreationTimestamp() == stat.getCreationTimestamp()
&& localStat.getVersion() > stat.getVersion()) {
updateCursorPropertiesResult.complete(null);
return;
}
}
updateCursorLedgerStat(copy, stat);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Make the success-side version check and cache update atomic

A delayed success reply checks that its V+1 snapshot is still current. After it releases 'cursorPropertiesLock', a conflict refresh waiting on an asynchronous ownership check finishes on another thread and installs V+2. The success reply then reacquires the lock inside the unconditional update and installs V+1. 'getCursorProperties()' returns stale values again, and the cached version rolls back, so the next property update can hit an avoidable version conflict. The durable record remains at V+2.

The success callback releases the lock at line 611 before updating at line 612. The refresh continuation at lines 646–648 can run on the ownership future’s completion thread, independently of the ordered metadata callback. A temporary scheduling hook paused the success reply in that gap. The test observed the refresh install 'k=newer', then the successful reply reverted the cache to 'k=first' while a durable read still returned 'k=newer'. The PR’s passing regression installs the newer value before the success callback starts, so it does not cover this interleaving.

Use one shared version-aware adoption helper that checks and publishes the cached record, properties, and version in the same critical section. Keep retained-ledger cleanup and future completion outside the lock. Continue reporting success when a committed reply is too old to adopt.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 1778f38: the check and the publication now run in one critical section. Every adoption — the failure refresh and the success callback of the write itself — goes through one shared helper, adoptCursorInfoIfNotOlder, which decides notOlder and publishes the record, properties and version under a single acquisition of cursorPropertiesLock. A committed reply that is too old to adopt still reports success, retained-ledger cleanup runs after the helper returns (outside the lock), and the future is completed outside as before.

testDelayedSuccessReplyConcurrentWithRefreshKeepsTheNewestSnapshot drives the delayed reply against a conflict refresh whose ownership check is a future the test settles, together with a later write released at the same barrier, and asserts the end-state invariant: the cached properties equal the durable record. With the check and the publication split again — and the gap widened the way your scheduling hook did — the test fails consistently (3/3) with the cache rolled back to the older reply; with the single critical section it passes 5/5. The unwidened split is a nanosecond window, so the red side needs the widened gap, as with your probe.

@nodece
nodece force-pushed the fix-cursor-properties-refresh-after-metadata-error branch from 9028fb7 to 1778f38 Compare November 30, 2026 06:35
@nodece
nodece requested a review from codelipenghui November 30, 2026 06:36

@codelipenghui codelipenghui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The shared lock now closes the previously reported cache rollback race, and all 29 cursor-property tests passed. The refactor drops one cleanup step: when a refresh adopts a newer record, it no longer reclaims cursor ledgers that the record proves are unreferenced. A focused test reproduced the leak and passed after restoring cleanup outside the lock.

Comment on lines +663 to +669
FutureUtil.supplySafely(ledger.mlOwnershipChecker).whenComplete((owned, error) -> {
if (error == null && Boolean.TRUE.equals(owned) && !state.isClosed()) {
adoptCursorInfoIfNotOlder(current, stat);
if (ownWrite) {
updateCursorPropertiesResult.complete(null);
return;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reclaim retained cursor ledgers after adopting a refreshed record

A cursor-ledger publication times out and its candidate is retained. A property write then commits without referencing that ledger, but its success reply is delayed. Another writer advances the record, and a conflict refresh adopts that newer record before the delayed reply arrives. Neither callback reclaims the now-unreferenced BookKeeper ledger. A later cursor metadata update can still reclaim it, but if the broker restarts before that happens, the in-memory tracking entry is lost and the ledger can remain orphaned.

Both property-refresh branches ignore the return value from 'adoptCursorInfoIfNotOlder' and skip cleanup. The delayed success branch correctly skips adoption of the older record, so it skips cleanup too. The previous refresh helper called 'updateCursorLedgerStat', which also ran cleanup. In the focused test, the cache correctly kept the later property value, but the specific retained ledger remained allocated. Restoring cleanup on successful refresh adoption made the test pass.

After a refresh actually adopts the record, run 'deleteUnreferencedRetainedCursorLedgers(current, stat)' outside 'cursorPropertiesLock', as the success path does. Share that post-adoption step across both refresh branches without weakening the ownership or version checks.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 1dc402e: both refresh branches now consume the adoptCursorInfoIfNotOlder result and, when a record is actually adopted, run deleteUnreferencedRetainedCursorLedgers(current, stat) after the helper returns — outside cursorPropertiesLock, the way the success callback does. The ownership and version checks are unchanged, and the too-old success reply still adopts nothing and reclaims nothing.

testRefreshAdoptionReclaimsRetainedCursorLedgers reproduces the scenario: a publication times out and its candidate is retained; a property write commits without referencing it while its reply is held; a conflicting update refreshes its base and commits a newer record; and the cursor's next property write conflicts and adopts that record. The test asserts the retained ledger is reclaimed (ledgersCreatedSince ends empty) while the cache keeps the adopted value, and that the too-old delayed reply claims nothing back. Reverting the two branches to ignore the adoption result turns the test red with the retained ledger still allocated.

computeCursorProperties updated the cached properties and version only in
operationComplete. On operationFailed the cache kept the pre-write state: after
a version conflict it did not reflect the writer that committed first, and
after a failure that lost the response of a committed write it still claimed
the write had not landed. A caller deciding from the cache then acted on a
snapshot that predated its own write: the delayed-delivery snapshot reclaim,
for example, concluded that an unpublished replacement ledger was not
referenced by the cursor property and deleted the ledger the property pointed
at.

On any failure the cursor now re-reads its info from the store before
completing the future. While this broker still owns the ledger it adopts the
stored properties and version, so a retry sees the current state; when the
stored record carries this attempt's publication id the write was committed
and the call completes successfully. On a ledger without an ownership checker
only that own write is adopted, never another writer's version, and not once
the cursor is closed, so a later position persist or close cannot succeed
against a version picked up from someone else.

Every adoption — the failure refresh and the success callback of the write
itself — goes through one helper whose version check and cache publication run
in a single critical section. With the check and the publication split, a
conflict refresh completing an asynchronous ownership check on another thread
could install a newer snapshot between them, and the success reply of an older
write would then roll the cache back to it. A committed reply that is too old
to adopt still reports success, retained-ledger cleanup and the completion of
the future stay outside the lock, and every branch that actually adopts a
record reclaims the retained cursor ledgers that the adopted record proves
unreferenced — otherwise a broker restart before the next metadata update
would leave them orphaned.

The refresh is best effort: if the ownership check or the re-read fails, or
the write commits after the re-read was served, the cache keeps the pre-write
state and the caller sees the original error.

Assisted-by: Claude Code
@nodece
nodece force-pushed the fix-cursor-properties-refresh-after-metadata-error branch from 1778f38 to 1dc402e Compare November 30, 2026 07:40
@nodece
nodece requested a review from codelipenghui November 30, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants