Skip to content

Postgres record job clock projection rejects legacy boolean enqueue age (PL-482) #24960

Open

Description

@Git-on-my-level

The PL-482 shared recording-drain contract reproduces a replacement-store gap on origin/main at c933665d495f.

A retained record_pending job with enqueued_at=True is accepted by the old Firestore store and simulator. The production drainer deliberately treats booleans as unknown age and retries after 60 seconds. The Postgres store rejects the same document in PostgresStore.write_doc, before the drainer can inspect it:

psycopg.errors.InvalidTextRepresentation:
invalid input syntax for type double precision: "true"

The jobs table's numeric projection casts the JSON value to double precision. A replacement-store import/write boundary must preserve the legacy malformed-age policy (unknown/young), without changing the retained document's custody or letting a bad age expire it. Do not reinterpret True as a valid epoch or discard the recording.

Reproduction: synthetic record_pending job through Store.run(tx.put) with enqueued_at=True, then the production live.drain_recordings. The new shared guard is backend/scripts/record_dead_letter_emulator_test.py::test_pl482_barrier_retry_uses_durable_age_and_returns_at_the_bounded_deadline[postgres-True-60] on lane/parity-pl487. Full local runner with OMI_REQUIRE_STORE_BACKENDS=all: 80 passed, one failed, zero skips. Firestore/simulator pass the same case. No production data or service is used.

Acceptance: the unchanged shared case passes on Postgres; valid clocks still select the right retry delay, malformed age remains young, and all custody/policy fields survive. A strict, exact-error expected failure will preserve this gap until repaired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions