Skip to content

fix(boot): an org whose datasets share a config version number still boots (#1445) - #1446

Merged
athvin merged 1 commit into
mainfrom
fix/1445-boot-multi-dataset
Nov 29, 2026
Merged

athvin merged 1 commit into
mainfrom
fix/1445-boot-multi-dataset

Conversation

@athvin

@athvin athvin commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Closes #1445

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

What

Fixes the er-dev boot failure. ensure_default_dataset_for read the org's active config with query_opt over (org_id, version), and it now takes LIMIT 1.

Why

er-dev deploys have been broken since about 12:45Z. er-schema-migrate failed with query returned an unexpected number of rows (run 46264663476). Config versions are numbered per dataset, so a second dataset's own v1 (p3live/spill10m, created for #558) made that read return two rows.

Proof

New pg_boot_multi_dataset: an org with two datasets that each publish v1, then a boot. Against the old fixups.rs it fails with the live RowCount; with the fix it passes. make check running locally.

Risk & rollback

One read in the boot sweep. An org with a second dataset already has its default, and the ensure is ON CONFLICT DO NOTHING, so which row answers can't change anything. Rollback: git revert <merge-sha> (deploys break again while p3live/spill10m exists).

Post-merge ledger

Closed by: agent · session Claude Code:24d16c2e-fec6-49d8-9797-060338df4848 on brians-MacBook-Pro · 2026-11-29T13:57:39Z

  • main is green with this change on it — the merge SHA, and the run
    that proves it. A later head SHA with this commit as an ancestor counts;
    a cancelled run with zero jobs does not: — 6110fdb, rust 46268239922 + frontend 46268240000 success
  • images built, or correctly never ran because nothing that goes into
    an image changed: — success, run 46268239869
  • deploy converged — proved by a line the running process emitted, not
    by the image digest and not by the workflow conclusion: — run 46268589537 (DEPLOY_SHA 6110fdb) success; web-api-blue logged 'er-server listening' at 13:40:19Z with p3live holding two datasets at config v1, the exact state that failed the previous two deploys
  • the push-only surface no pull request can pre-test (deploy, drift,
    kind's nightly leg) is green, or knowingly red for a reason that is not
    this change: — infra, devcontainer success on 6110fdb
  • the board card reached Done through the automation rather than by
    hand, and the issue closed: — fix(boot): an org with two datasets each at config v1 fails every boot — ensure_default_dataset_for's config read returns two rows #1445 CLOSED by fix(boot): an org whose datasets share a config version number still boots (#1445) #1446 via automation
  • follow-ups are open for everything deferred here — numbers: — none
  • what was learned is written down where the next session will find it
    (a skill, a reference, memory) — or nothing new was learned: — a RowCount in ensure_schema I first dismissed as a test artifact was this bug: a local failure in the boot path is a finding until proven otherwise

Specific to this change

Context — plan, discoveries, measurements, files

Plan

Discoveries

Measurements

Files

🤖 Generated with Claude Code

…boots (#1445)

ensure_default_dataset_for runs on every boot and read the org's active
config with query_opt over (org_id, version). Config versions are
numbered per dataset, so once an org has a second dataset that published
its own v1, the read matched two rows. RowCount then failed ensure_schema,
and er-schema-migrate failed with it. Every er-dev deploy since about
12:45Z has failed this way (run 46264663476). The trigger was
p3live/spill10m, created for #558.

The read now takes LIMIT 1. An org with a second dataset already has its
default, and the ensure is ON CONFLICT DO NOTHING, so which row answers
only matters when exactly one exists.

pg_boot_multi_dataset: a BYO org plus a second dataset, each publishing
v1, then a boot. It fails with the live RowCount against the old
fixups.rs and passes with the fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@athvin
athvin merged commit 6110fdb into main Nov 29, 2026
40 of 41 checks passed
@athvin
athvin temporarily deployed to marketing-preview November 29, 2026 13:35 — with GitHub Actions Inactive

This branch was previously deployed

1 inactive deployment
marketing-preview — c3099c3e Deployed Nov 29, 2026 by athvin via remove closed PR previews #170
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(boot): an org with two datasets each at config v1 fails every boot — ensure_default_dataset_for's config read returns two rows

2 participants