Skip to content

replicatedConfirmation of a write that lost to an unreplicated entry waits until timeout #3387

Open

Description

@kriszyp

Summary

A replicatedConfirmation commit whose write lost to a newer stored entry (commit handler marks it skipped) confirms on that stored entry's version (harper#3182's fallback in DatabaseTransaction.confirmationTarget / lastConfirmableEntry). If the surviving entry was itself never replicated, the wait cannot be satisfied and the commit runs to the confirmation timeout (504):

  • the table is audit: false (the survivor appended no audit entry), or
  • the survivor was a { localOnly: true } write on an audited table (its entry is LOCAL_ONLY).

Reaching it

Needs a confirmed local write carrying an explicit context.timestamp older than the stored record (or a retry round that flips the write), e.g. seed a localOnly row, then issue a confirmed delete with an older timestamp: _writeDelete marks it skipped, and confirmationTarget() selects the survivor's unreplicated version.

Context

The companion PR stops waiting on writes whose own staging appended nothing replicable (unaudited, copy-apply, local-only); it deliberately keeps the skipped-write fallback, since a skipped write appended nothing and the eligibility of the entry that beat it is a separate question. Likely shape: qualify the fallback by the survivor's own replicability (record LOCAL_ONLY metadata flag; table audit), or exempt skipped writes on unaudited tables.

Review-Deferral: 74aa46a29a0859c8 severity=major category=correctness

Validation no-ops use the same survivor fallback

A RocksDB patch with no changes can return from validateWrite() === false before save() sets stagedAudit. It remains saved in the transaction's write list, so confirmation uses the existing entry's version and runs the feasibility check. If the survivor is unaudited or local-only, confirmation has nothing replicable to acknowledge. The path also exists on main, independently of #3423; include it when qualifying survivor eligibility. LMDB removes validation no-ops from its write list.

Review-Deferral: 4aa5385c5e4048b2 severity=major category=correctness

The latest pre-push reviewer classified the correctness findings as major under its generic review floor; the author rates the impact as contained because an explicit confirmation request and the stated edge case are required. These are pre-existing behaviors. Issue priority and milestone are unchanged.

🤖 Generated by Claude Code and OpenAI Codex; posted via @kriszyp.

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

    Fields

    Priority

    P3

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions