M12.7: reconcile pending migration evidence in census snapshots
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 2m26s
Foundation / checks (network) (push) Successful in 21m1s
Foundation / checks (client) (push) Successful in 22m9s
Foundation / checks (tsan) (push) Successful in 24m36s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 33m38s
Foundation / checks (checks) (push) Canceled after 33m49s

This commit is contained in:
dingo
2026-10-18 21:14:53 -04:00
parent 709dfb9557
commit 27ec5729bf
23 changed files with 592 additions and 23 deletions
+13 -3
View File
@@ -127,6 +127,7 @@ SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname='evolution')
SELECT :'history_v48' || ',49:' || :'migration_sha_49' AS history_v49 \gset
SELECT :'history_v49' || ',50:' || :'migration_sha_50' AS history_v50 \gset
SELECT :'history_v50' || ',51:' || :'migration_sha_51' AS history_v51 \gset
SELECT :'history_v51' || ',52:' || :'migration_sha_52' AS history_v52 \gset
SELECT :'history' = :'history_v22' AS at_v22,
:'history' = :'history_v23' AS at_v23,
:'history' = :'history_v24' AS at_v24,
@@ -156,8 +157,10 @@ SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname='evolution')
:'history' = :'history_v48' AS at_v48,
:'history' = :'history_v49' AS at_v49,
:'history' = :'history_v50' AS at_v50,
:'history' = :'history_v51' AS at_v51 \gset
\if :at_v51
:'history' = :'history_v51' AS at_v51,
:'history' = :'history_v52' AS at_v52 \gset
\if :at_v52
\elif :at_v51
\elif :at_v50
\elif :at_v49
\elif :at_v48
@@ -553,7 +556,8 @@ SELECT coalesce(max(version), 0) = 24 AS at_v24,
coalesce(max(version), 0) = 48 AS at_v48,
coalesce(max(version), 0) = 49 AS at_v49,
coalesce(max(version), 0) = 50 AS at_v50,
coalesce(max(version), 0) = 51 AS at_v51
coalesce(max(version), 0) = 51 AS at_v51,
coalesce(max(version), 0) = 52 AS at_v52
FROM evolution.schema_migrations \gset
\if :at_v24
\ir 0025_cellular_v2_bundle.sql
@@ -773,6 +777,7 @@ SELECT coalesce(max(version), 0) = 24 AS at_v24,
\elif :at_v49
\elif :at_v50
\elif :at_v51
\elif :at_v52
\else
\echo 'Unknown or changed migration history after v43'
DO $$ BEGIN RAISE EXCEPTION 'unknown or changed migration history'; END $$;
@@ -809,6 +814,10 @@ SELECT coalesce(max(version), 0) = 50 AS needs_v51 FROM evolution.schema_migrati
\if :needs_v51
\ir 0051_database_history_domain.sql
\endif
SELECT coalesce(max(version), 0) = 51 AS needs_v52 FROM evolution.schema_migrations \gset
\if :needs_v52
\ir 0052_census_pending_migrations.sql
\endif
-- Effective-privilege audit on every run, including no-ops (ADR-0060). Attributes
-- alone are insufficient: predefined roles such as pg_write_all_data, PUBLIC
-- grants or SET-able memberships would bypass the fenced functions. Checks the
@@ -828,6 +837,7 @@ BEGIN
UNION
SELECT m.member FROM pg_catalog.pg_auth_members m JOIN closure c ON m.roleid = c.oid
), fenced(oid) AS (VALUES
('evolution.load_world_cellular_migrations_v1(evolution.u64)'::regprocedure::oid),
('evolution.load_history_domain_v1()'::regprocedure::oid),
('evolution.load_world_region_catalog_v1(evolution.u64)'::regprocedure::oid),
('evolution.publish_cellular_migration(uuid,bytea,bytea,uuid,evolution.u64,uuid,evolution.u64)'::regprocedure::oid),