From 3de9992955c763c229a3cf57cb5b2ec9b4cf87a9 Mon Sep 17 00:00:00 2001 From: jonahgabriel Date: Tue, 28 Jul 2026 05:55:18 -0400 Subject: [PATCH] fix(OMN-15312): wrap vendored delegation reconcile migration 0009a in an explicit transaction Vendored-copy half of the fix; canonical source is omnimarket src/omnimarket/nodes/node_projection_delegation/migrations/ (OMN-12559 auto-discovery). Both copies are byte-identical (sha256 b2e66b31...) so the next vendor sync is a no-op rather than a silent revert. The forward-migration runner applies node migrations with psql -f in autocommit, so LOCK TABLE errored with ERROR: LOCK TABLE can only be used in transaction blocks exiting 3 and aborting every cold-lane bring-up (OMN-13414), the only documented recovery for the GC-reclaimed dev lane (OMN-15190). Proven RED then GREEN against a cold omnidash_analytics on the .201 dev lane. --- .../0009a_delegation_events_legacy_schema_reconcile.sql | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docker/migrations/forward/nodes/node_projection_delegation/0009a_delegation_events_legacy_schema_reconcile.sql b/docker/migrations/forward/nodes/node_projection_delegation/0009a_delegation_events_legacy_schema_reconcile.sql index 4a85d8faf6..c666140154 100644 --- a/docker/migrations/forward/nodes/node_projection_delegation/0009a_delegation_events_legacy_schema_reconcile.sql +++ b/docker/migrations/forward/nodes/node_projection_delegation/0009a_delegation_events_legacy_schema_reconcile.sql @@ -8,6 +8,13 @@ -- partial conversion. The staging table was measured at 6 rows / 128 kB before -- rollout, so the in-place JSONB-to-integer rewrite is deliberately preferred -- over a permanent dual-column compatibility path. +-- The runner (scripts/run-forward-migrations.sh) applies node migrations with +-- `psql -f` in autocommit, one statement per implicit transaction. The SET LOCAL +-- scoping and the LOCK TABLE below are only legal inside an explicit transaction +-- block, and the partial-conversion guarantee described above requires one, so +-- this migration opens its own (OMN-15312). +BEGIN; + SET LOCAL lock_timeout = '5s'; SET LOCAL statement_timeout = '2min'; LOCK TABLE delegation_events IN ACCESS EXCLUSIVE MODE; @@ -173,3 +180,5 @@ BEGIN ALTER COLUMN quality_gates_failed SET NOT NULL; END $reconcile_failed$; + +COMMIT;