Skip to content

lifecycle: a phase event's "now" is read before it waits for the writer, so it can be refused as out of order #108

Closed

Description

@TusanHomichi

Existing issue check

  • I searched open and closed issues for this work.

Problem or outcome

lifecycle::record_phase_event reads now, which is the effective instant when the caller gives none, before storage::write_tx waits for the writer. Inside the transaction it refuses any event older than the newest committed one as OutOfOrder. So a request for "now" that waits across a second boundary, while another phase event commits, is refused as out of order. The honest answer would be the state check (AlreadyPaused and so on), or plain success.

Observed in CI on pr-gate for #106, a PR that doesn't touch lifecycle: write_transactions::training_writes::phase_events_validate_the_committed_pause_state failed with left: OutOfOrder, right: AlreadyPaused (job). Two concurrent pauses read now on either side of a second boundary; the later one committed first.

In the product it's the same thing whenever a phase-event request waits on a busy writer: two coordinators acting at once, or any long write transaction.

Scope

In scope:

  • Read the implicit "now", and check the future-instant refusal, after the write lock is held.
  • A deterministic test: a request waits on a held writer while a later event commits, and gets the state refusal, not OutOfOrder.

Out of scope:

  • Explicit back-dated events. They keep the effective-order refusal.

Acceptance criteria

  • The deterministic test passes, and fails on the old ordering (negative control).
  • write_transactions passes.

Execution record

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