Skip to content

A retry after a conflict at commit keeps its own @createdTime over a concurrent creator's #3975

Closed as duplicate

Description

@kriszyp

What happens

A PUT or PATCH that creates a record stamps @createdTime in _writeUpdate's validate (resources/Table.ts, stampRecordTimes), from the commit base it saw then. If its commit then conflicts at commit (ConflictKind.atCommit, or any retry whose log batch is already written) because a concurrent writer created the same record first, the retry reloads that base but never re-runs validate. The retry stores the record with its own @createdTime, which overwrites the creator's. Nothing reports it, and the value stays wrong.

Why it isn't a one-line restamp

The attempt's transaction-log batch is already durable and carries the validate-time times. A retry that keeps that batch must store what the batch says, or the local record and what replication ships disagree. A fix has to re-log the batch when the reloaded base changes the stamped values. That interacts with the retry cap and dedup accounting from #3928.

The refused-before-log case (relogOnRetry), where the batch is written fresh, is fixed separately by the PR that links this issue.

Repro sketch

unitTests/resources/abortMarkersAdoption.test.js's conflictAtCommit helper, on a table with assignCreatedTime: the competitor creates the unseeded id with an older timestamp; mine reads (nothing), then PUTs. Expect created to be the competitor's; it is mine's first-attempt time.

Review-Deferral: 1209e9e264aa6025 severity=minor category=correctness

Activity

  1. added theissue type on Nov 3, 2026
  2. kriszyp commented on Nov 10, 2026

    @kriszyp
    MemberAuthor

    Folded into #3890. It is the same mechanism: a conflict retry never re-runs validate and stampRecordTimes, so the retry keeps its own @createdTime over the concurrent creator's. One constraint from this issue must carry over to that fix: when the attempt's transaction-log batch is already durable (ConflictKind.atCommit), a restamp must re-log the batch, or the stored record and what replication ships will disagree. That re-log interacts with the retry cap and dedup accounting from #3928.

    🤖 Claude Opus 5.5, closed for @kriszyp after the 2026-11-09 triage pass.

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