Skip to content

[Bug] Individual ACKs racing with a durable cursor reset can overwrite its checkpoint or lose their callback #27668

Open

Description

@void-ptr974

User environment

Found during managed-ledger review of #26973. The same ordering exists on master at 38b4615c72b. Review discussion

Issue description

An individual ACK arriving through asyncDelete after a durable cursor reset has submitted its write can run into two cases.

  • If the ACK is submitted immediately, it can append a cursor record computed from the pre-reset state after the reset record. The reset can report success, then recovery can load that later record and undo the reset. Reviewer reproduction
  • If a read is pending, the ACK's mark-delete entry can queue after the reset write was submitted. When reset completes successfully, it clears pendingMarkDeleteOps and the queued ACK's callback is never invoked. This path was identified in review and confirmed by source inspection. Review follow-up

Reproducing the issue

  1. Pause completion of a submitted backward reset, issue an individual ACK, then let the reset complete. Inspect the last cursor-ledger record or recover from it before a graceful close can rewrite the checkpoint.
  2. Pause completion of a submitted reset, then hold a read open and issue an individual ACK so it queues. Release the reset before the read and check whether the ACK callback completes.

Expected behavior

Recovery after a successful reset preserves the reset checkpoint and any ACKs valid under the chosen ordering. Each ACK callback completes exactly once with the corresponding result. Cover both interleavings with deterministic tests and coordinate ACK admission and queue settlement under the same pendingMarkDeleteOps lock.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions