Skip to content

Postgres conformance: row-storage lease check fails once real time passes the settling harness's fixed clock #1792

Closed

Description

@bokelley

tests/conformance/reporting/test_reporting_row_storage_object_pg.py::test_the_producer_stages_object_uploads_outside_its_publication_transaction fails on next, on main-based branches, and locally since 2026-11-01, with no related code change:

ReportingRowStoreError: Reporting row store: STATE_UNAVAILABLE: no live worker lease covers this row upload

The last green next CI run was 2026-10-31T22:11Z (run 41247073211); every run on 2026-11-01 fails this one test (seen on #1787, #1788, #1790, which touch no related code, and on a plain next worktree locally).

Cause. The test uses tests/test_reporting_settling.py::_harness, whose clock is pinned at datetime(2026, 11, 1, 2, 10, tzinfo=UTC). The producer stamps reporting_configurations.lease_expires_at from that fake clock, but adcp_reporting_storage/ledger/row_write.py verifies the lease against the database's real time:

... AND c.lease_expires_at > clock_timestamp()

Once wall-clock time passes the fixed clock plus the lease length, no row upload is "covered" and the test fails. Any test that combines a frozen application clock with this DB-clock check has the same shelf life.

Options. Pin the database clock for the test (e.g. compare against the store's clock when one is injected, or widen the lease in the harness for PG runs), or move the harness clock to a date far in the future. Either way the check's production semantics (DB clock, so hosts agree) should stay.

Blocks "fully green" CI on every PR against next and main today.

Activity

  1. bokelley commented on Nov 1, 2026

    @bokelley
    ContributorAuthor

    Fixed on next by #1767 (c1c6d6eb): test_the_producer_stages_object_uploads_outside_its_publication_transaction now runs the producer's turn at the wall clock. The lease the injected clock stamps then lies in the database's real future, and row_write.py's clock_timestamp() check keeps its production semantics.

    Verified locally against PostgreSQL 16 at 2026-11-01T23:39Z, past the harness's frozen 02:10 plus the lease: test_reporting_row_storage_object_pg.py and test_reporting_period_retirement_pg.py, the other row-storage file that uses _harness, give 40 passed. A full local run of tests/conformance/reporting/ showed no other lease failure. next's CI hasn't finished a run since the merge (runners are queued); reopen if the Postgres lane still shows it.

  2. bokelley commented on Nov 2, 2026

    @bokelley
    ContributorAuthor

    More evidence, from a local PostgreSQL 16 and from CI re-runs:

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