Skip to content

Ordered-loader oracle: successful repair acquisition released before a later authoritative read succeeds #2480

Backlog

Description

@KyleAMathews

The latest PR checks for #2420 fail the ordered-loader request-authority oracle. The comparison reports that a successful acquisition is released before a later authoritative read succeeds.

CI evidence

  • Failed Test (db-2) job.
  • PR head: 8ebe5eaae3a9dc1869e396ea69d22dc0e9e7c953.
  • Tested merge commit: 5dd1abc03459684312eeb6dcf3fda00fcbf3f03e, against base e462d35cdd7aeef5de4e646538bd1594a94d8425.
  • Owner: packages/db/tests/query/ordered-source-loader-state-oracle.test.ts.
  • Test: holds, retires, and recovers requests under generated settlement orders.
  • Property: ordered-loader.request-authority; unit: random seed: generated.
  • Failed after 5,587 generated tests; shrunk 11 times.
  • Seed: 1040058663.
  • Shrink path: 5586:1:1:1:5:4:8:8:10:11:20:22.
  • Failure: checkHeld at line 2154, called from checkAuthorityCase at line 2600. Reported oracle checkpoint: line 1638.
held after step 6: request 4, a successful acquisition of repair chain 3, was released before a later authoritative read succeeded

The shard reports 1 failed test and 36,136 passed tests. The aggregate Test check fails because DB_RESULT=failure; it does not contain another test failure.

Shrunk history

{
  "indexed": false,
  "limit": 1,
  "settledFirst": true,
  "releaseFault": false,
  "syncRepair": false,
  "requiresFullSource": false,
  "joined": false,
  "snapshotRows": 1,
  "needsMore": true,
  "retryTimer": false,
  "releaseTruncates": true,
  "offset": 0,
  "releaseReenters": false,
  "releaseDisposes": false,
  "releaseInvalidates": true,
  "history": [
    {
      "type": "settle",
      "pick": 0,
      "ok": true
    },
    {
      "type": "settle",
      "pick": 0,
      "ok": true
    },
    {
      "type": "move",
      "delta": -1
    },
    {
      "type": "settleNewest"
    },
    {
      "type": "unexpressibleBoundary"
    },
    {
      "type": "settle",
      "pick": 0,
      "ok": true
    },
    {
      "type": "replaySucceeds"
    },
    {
      "type": "timer"
    }
  ]
}

Step 6 is replaySucceeds (zero-based). The shrunk case has asynchronous repair, no join, an unexpressible boundary, and both releaseTruncates and releaseInvalidates enabled.

Replay

Run from the repository root at the tested merge commit:

TANSTACK_DB_ORACLE_SEED=1040058663 \
TANSTACK_DB_ORACLE_PATH=5586:1:1:1:5:4:8:8:10:11:20:22 \
TANSTACK_DB_ORACLE_PROPERTY=ordered-loader.request-authority \
TANSTACK_DB_ORACLE_UNIT='random seed: generated' \
pnpm --filter @tanstack/db exec vitest run \
  tests/query/ordered-source-loader-state-oracle.test.ts \
  -t '^Ordered source request authority(?: | > )holds, retires, and recovers requests under generated settlement orders(?: | > )ordered-loader\.request-authority(?: | > )random seed: generated$' \
  --coverage.enabled=false --typecheck.enabled=false --maxWorkers=1

Scope and next step

This records the executed CI assertion. It has not been replayed locally or diagnosed as a production defect versus an oracle model, driver, or checkpoint defect. It does not establish incorrect public query rows.

The oracle cites query/live/ARCHITECTURE.md, “Ordered requests, continuation, and recovery” and “Atomic window publication,” as its authority. Diagnose acquisition ownership across replay and release-triggered invalidation before changing production or the model. The generated campaign already reaches this case; preserve the shrunk history through the same model, production driver, and comparison during repair, and exercise nearby generated histories.

Related issues were checked:

No matching issue was found for this assertion or seed.

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