Add isolated cellular checkpoint publisher
Foundation / checks (client) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (checks) (push) Failing after 38s
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 43s
Foundation / checks (ecs) (push) Canceled after 54s
Foundation / checks (tsan) (push) Canceled after 24s
Foundation / checks (client) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (checks) (push) Failing after 38s
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 43s
Foundation / checks (ecs) (push) Canceled after 54s
Foundation / checks (tsan) (push) Canceled after 24s
This commit is contained in:
@@ -0,0 +1,194 @@
|
||||
-- M11.3d-6a, ADR-0112: isolated profile-4 checkpoint and action publication.
|
||||
-- The private action block is inserted in the same transaction as the checkpoint;
|
||||
-- direct calls to the generic writer cannot pass the profile-4 commit trigger.
|
||||
CREATE TABLE evolution.cellular_publications (
|
||||
commit_id uuid PRIMARY KEY REFERENCES evolution.region_commits(commit_id)
|
||||
DEFERRABLE INITIALLY DEFERRED,
|
||||
actions bytea NOT NULL CHECK (octet_length(actions) <= 49152)
|
||||
);
|
||||
REVOKE ALL ON evolution.cellular_publications FROM PUBLIC;
|
||||
CREATE TRIGGER cellular_publications_immutable BEFORE UPDATE OR DELETE
|
||||
ON evolution.cellular_publications FOR EACH ROW
|
||||
EXECUTE FUNCTION evolution.refuse_history_rewrite();
|
||||
CREATE TRIGGER cellular_publications_no_truncate BEFORE TRUNCATE
|
||||
ON evolution.cellular_publications FOR EACH STATEMENT
|
||||
EXECUTE FUNCTION evolution.refuse_history_rewrite();
|
||||
|
||||
CREATE FUNCTION evolution.check_cellular_action_block(p_actions bytea,
|
||||
p_begin numeric, p_end numeric)
|
||||
RETURNS integer LANGUAGE plpgsql IMMUTABLE SECURITY INVOKER
|
||||
SET search_path = pg_catalog, pg_temp AS $$
|
||||
DECLARE
|
||||
n integer := coalesce(octet_length(p_actions), -1);
|
||||
account bytea;
|
||||
action_id numeric;
|
||||
input_bytes bytea;
|
||||
tick numeric;
|
||||
prev_tick numeric := -1;
|
||||
prev_account bytea := ''::bytea;
|
||||
prev_id numeric := -1;
|
||||
seen text[] := '{}';
|
||||
BEGIN
|
||||
-- Each record: account UUID (16), action id (u64 LE), canonical input (24).
|
||||
IF n < 0 OR n % 48 <> 0 OR n / 48 > 1024 THEN
|
||||
RAISE EXCEPTION 'invalid cellular action block' USING ERRCODE = '22023';
|
||||
END IF;
|
||||
FOR i IN 0 .. n / 48 - 1 LOOP
|
||||
account := substring(p_actions FROM 48 * i + 1 FOR 16);
|
||||
action_id := evolution.manifest_uint(p_actions, 48 * i + 16, 8);
|
||||
input_bytes := substring(p_actions FROM 48 * i + 25 FOR 24);
|
||||
tick := evolution.manifest_uint(input_bytes, 0, 8);
|
||||
IF account = decode(repeat('00', 16), 'hex') OR action_id = 0
|
||||
OR tick <= p_begin OR tick > p_end
|
||||
OR NOT evolution.valid_cellular_action_input(input_bytes, tick)
|
||||
OR (tick, account, action_id) <= (prev_tick, prev_account, prev_id) THEN
|
||||
RAISE EXCEPTION 'invalid cellular action record' USING ERRCODE = '22023';
|
||||
END IF;
|
||||
IF encode(account, 'hex') || ':' || action_id::text = ANY (seen) THEN
|
||||
RAISE EXCEPTION 'duplicate cellular action id' USING ERRCODE = '22023';
|
||||
END IF;
|
||||
seen := seen || (encode(account, 'hex') || ':' || action_id::text);
|
||||
prev_tick := tick;
|
||||
prev_account := account;
|
||||
prev_id := action_id;
|
||||
END LOOP;
|
||||
RETURN n / 48;
|
||||
END $$;
|
||||
|
||||
-- Replace the temporary M11.3 profile-4 refusal gate. Evidence can only be
|
||||
-- inserted by publish_cellular_checkpoint; the runtime role has no table grant.
|
||||
CREATE OR REPLACE FUNCTION evolution.refuse_unpublished_cellular() RETURNS trigger
|
||||
LANGUAGE plpgsql SECURITY INVOKER SET search_path = pg_catalog, pg_temp AS $$
|
||||
BEGIN
|
||||
IF evolution.manifest_uint(NEW.manifest, 12, 4) = 4 AND NEW.commit_sequence > 0
|
||||
AND NOT EXISTS (SELECT 1 FROM evolution.cellular_publications p
|
||||
WHERE p.commit_id = NEW.commit_id) THEN
|
||||
RAISE EXCEPTION 'cellular publication evidence required' USING ERRCODE = 'EVL06';
|
||||
END IF;
|
||||
RETURN NEW;
|
||||
END $$;
|
||||
|
||||
-- The former two-argument function becomes a private transaction core. Its
|
||||
-- public name remains a frozen profile-1/2/3 wrapper, while profile 4 can enter
|
||||
-- the core only through publish_cellular_checkpoint below.
|
||||
ALTER FUNCTION evolution.publish_region_checkpoint(bytea,bytea)
|
||||
RENAME TO publish_region_checkpoint_core;
|
||||
REVOKE ALL ON FUNCTION evolution.publish_region_checkpoint_core(bytea,bytea)
|
||||
FROM PUBLIC, :"runtime_role";
|
||||
CREATE FUNCTION evolution.publish_region_checkpoint(p_manifest bytea, p_decisions bytea)
|
||||
RETURNS TABLE(region_frame evolution.u64, head_sequence evolution.u64, head_commit uuid,
|
||||
head_digest text, head_tick evolution.u64)
|
||||
LANGUAGE plpgsql SECURITY DEFINER SET search_path = pg_catalog, pg_temp AS $$
|
||||
DECLARE
|
||||
c evolution.checkpoint_manifest := evolution.parse_checkpoint_manifest(p_manifest);
|
||||
BEGIN
|
||||
IF c.profile = 4 THEN
|
||||
RAISE EXCEPTION 'profile-4 requires cellular publisher' USING ERRCODE = 'EVL06';
|
||||
END IF;
|
||||
RETURN QUERY SELECT * FROM evolution.publish_region_checkpoint_core(p_manifest, p_decisions);
|
||||
END $$;
|
||||
REVOKE ALL ON FUNCTION evolution.publish_region_checkpoint(bytea,bytea) FROM PUBLIC;
|
||||
GRANT EXECUTE ON FUNCTION evolution.publish_region_checkpoint(bytea,bytea) TO :"runtime_role";
|
||||
|
||||
CREATE FUNCTION evolution.publish_cellular_checkpoint(p_manifest bytea,
|
||||
p_decisions bytea, p_actions bytea)
|
||||
RETURNS TABLE(region_frame evolution.u64, head_sequence evolution.u64, head_commit uuid,
|
||||
head_digest text, head_tick evolution.u64)
|
||||
LANGUAGE plpgsql SECURITY DEFINER SET search_path = pg_catalog, pg_temp AS $$
|
||||
DECLARE
|
||||
c evolution.checkpoint_manifest := evolution.parse_checkpoint_manifest(p_manifest);
|
||||
n integer;
|
||||
old_actions bytea;
|
||||
r record;
|
||||
BEGIN
|
||||
IF c.profile <> 4 OR c.commit_sequence = 0 OR p_actions IS NULL THEN
|
||||
RAISE EXCEPTION 'invalid cellular publication' USING ERRCODE = '22023';
|
||||
END IF;
|
||||
n := evolution.check_cellular_action_block(p_actions, c.begin_tick, c.end_tick);
|
||||
SELECT p.actions INTO old_actions FROM evolution.cellular_publications p
|
||||
WHERE p.commit_id = c.commit_id;
|
||||
IF FOUND THEN
|
||||
IF old_actions <> p_actions THEN
|
||||
RAISE EXCEPTION 'cellular commit identity reused' USING ERRCODE = 'EVL07';
|
||||
END IF;
|
||||
RETURN QUERY SELECT * FROM evolution.publish_region_checkpoint_core(p_manifest, p_decisions);
|
||||
RETURN;
|
||||
END IF;
|
||||
|
||||
PERFORM evolution.check_region_lease(c.world_id, c.region_id, c.holder, c.epoch);
|
||||
-- Recheck after the lease lock: an uncertain first attempt may have completed.
|
||||
SELECT p.actions INTO old_actions FROM evolution.cellular_publications p
|
||||
WHERE p.commit_id = c.commit_id;
|
||||
IF FOUND THEN
|
||||
IF old_actions <> p_actions THEN
|
||||
RAISE EXCEPTION 'cellular commit identity reused' USING ERRCODE = 'EVL07';
|
||||
END IF;
|
||||
RETURN QUERY SELECT * FROM evolution.publish_region_checkpoint_core(p_manifest, p_decisions);
|
||||
RETURN;
|
||||
END IF;
|
||||
|
||||
INSERT INTO evolution.cellular_publications(commit_id, actions)
|
||||
VALUES (c.commit_id, p_actions);
|
||||
FOR i IN 0 .. n - 1 LOOP
|
||||
INSERT INTO evolution.region_actions(world_id, account_id, action_id, region_id, tick,
|
||||
kind, commit_sequence, input_bytes, result)
|
||||
VALUES (c.world_id,
|
||||
encode(substring(p_actions FROM 48 * i + 1 FOR 16), 'hex')::uuid,
|
||||
evolution.manifest_uint(p_actions, 48 * i + 16, 8), c.region_id,
|
||||
evolution.manifest_uint(p_actions, 48 * i + 25, 8), 2, c.commit_sequence,
|
||||
substring(p_actions FROM 48 * i + 25 FOR 24), 5)
|
||||
ON CONFLICT (world_id, account_id, action_id) DO NOTHING;
|
||||
IF NOT EXISTS (SELECT 1 FROM evolution.region_actions a
|
||||
WHERE a.world_id = c.world_id
|
||||
AND a.account_id = encode(substring(p_actions FROM 48 * i + 1 FOR 16), 'hex')::uuid
|
||||
AND a.action_id = evolution.manifest_uint(p_actions, 48 * i + 16, 8)
|
||||
AND a.kind = 2 AND a.result = 5
|
||||
AND a.input_bytes = substring(p_actions FROM 48 * i + 25 FOR 24)) THEN
|
||||
RAISE EXCEPTION 'cellular action identity reused' USING ERRCODE = 'EVL07';
|
||||
END IF;
|
||||
END LOOP;
|
||||
-- The trigger on region_commits requires the private action-block row above.
|
||||
-- A failure here rolls back the block and all outcome rows with the head advance.
|
||||
SELECT * INTO r FROM evolution.publish_region_checkpoint_core(p_manifest, p_decisions);
|
||||
IF NOT FOUND THEN
|
||||
RAISE EXCEPTION 'publication returned no head' USING ERRCODE = 'XX000';
|
||||
END IF;
|
||||
RETURN QUERY SELECT r.region_frame, r.head_sequence, r.head_commit, r.head_digest,
|
||||
r.head_tick;
|
||||
END $$;
|
||||
|
||||
CREATE FUNCTION evolution.resolve_cellular_region_commit(p_world evolution.u64,
|
||||
p_region evolution.u64, p_commit uuid, p_manifest bytea, p_decisions bytea,
|
||||
p_actions bytea)
|
||||
RETURNS TABLE(status text, region_frame evolution.u64, head_sequence evolution.u64,
|
||||
head_commit uuid, head_digest text, head_tick evolution.u64)
|
||||
LANGUAGE plpgsql STABLE SECURITY DEFINER SET search_path = pg_catalog, pg_temp AS $$
|
||||
DECLARE
|
||||
c evolution.checkpoint_manifest := evolution.parse_checkpoint_manifest(p_manifest);
|
||||
old_actions bytea;
|
||||
BEGIN
|
||||
IF c.profile <> 4 OR c.commit_sequence = 0 OR c.world_id <> p_world
|
||||
OR c.region_id <> p_region OR c.commit_id <> p_commit OR p_actions IS NULL THEN
|
||||
RAISE EXCEPTION 'invalid cellular resolution request' USING ERRCODE = '22023';
|
||||
END IF;
|
||||
PERFORM evolution.check_cellular_action_block(p_actions, c.begin_tick, c.end_tick);
|
||||
SELECT p.actions INTO old_actions FROM evolution.cellular_publications p
|
||||
WHERE p.commit_id = p_commit;
|
||||
IF EXISTS (SELECT 1 FROM evolution.region_commits x WHERE x.commit_id = p_commit)
|
||||
AND (old_actions IS NULL OR old_actions <> p_actions) THEN
|
||||
RETURN QUERY SELECT 'conflict'::text, NULL::evolution.u64, NULL::evolution.u64,
|
||||
NULL::uuid, NULL::text, NULL::evolution.u64;
|
||||
RETURN;
|
||||
END IF;
|
||||
RETURN QUERY SELECT * FROM evolution.resolve_region_commit(p_world, p_region, p_commit,
|
||||
p_manifest, p_decisions);
|
||||
END $$;
|
||||
|
||||
REVOKE ALL ON FUNCTION evolution.check_cellular_action_block(bytea,numeric,numeric),
|
||||
evolution.publish_cellular_checkpoint(bytea,bytea,bytea),
|
||||
evolution.resolve_cellular_region_commit(evolution.u64,evolution.u64,uuid,bytea,bytea,bytea)
|
||||
FROM PUBLIC;
|
||||
GRANT EXECUTE ON FUNCTION evolution.publish_cellular_checkpoint(bytea,bytea,bytea),
|
||||
evolution.resolve_cellular_region_commit(evolution.u64,evolution.u64,uuid,bytea,bytea,bytea)
|
||||
TO :"runtime_role";
|
||||
INSERT INTO evolution.schema_migrations(version, sha256) VALUES (20, :'migration_sha_20');
|
||||
+26
-2
@@ -92,28 +92,36 @@ SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname='evolution')
|
||||
|| ',15:' || :'migration_sha_15' || ',16:' || :'migration_sha_16' AS at_v16,
|
||||
:'history' = '1:' || :'migration_sha' || ',2:' || :'migration_sha_2' || ',3:' || :'migration_sha_3' || ',4:' || :'migration_sha_4' || ',5:' || :'migration_sha_5' || ',6:' || :'migration_sha_6' || ',7:' || :'migration_sha_7' || ',8:' || :'migration_sha_8' || ',9:' || :'migration_sha_9' || ',10:' || :'migration_sha_10' || ',11:' || :'migration_sha_11' || ',12:' || :'migration_sha_12' || ',13:' || :'migration_sha_13' || ',14:' || :'migration_sha_14' || ',15:' || :'migration_sha_15' || ',16:' || :'migration_sha_16' || ',17:' || :'migration_sha_17' AS at_v17,
|
||||
:'history' = '1:' || :'migration_sha' || ',2:' || :'migration_sha_2' || ',3:' || :'migration_sha_3' || ',4:' || :'migration_sha_4' || ',5:' || :'migration_sha_5' || ',6:' || :'migration_sha_6' || ',7:' || :'migration_sha_7' || ',8:' || :'migration_sha_8' || ',9:' || :'migration_sha_9' || ',10:' || :'migration_sha_10' || ',11:' || :'migration_sha_11' || ',12:' || :'migration_sha_12' || ',13:' || :'migration_sha_13' || ',14:' || :'migration_sha_14' || ',15:' || :'migration_sha_15' || ',16:' || :'migration_sha_16' || ',17:' || :'migration_sha_17' || ',18:' || :'migration_sha_18' AS at_v18,
|
||||
:'history' = '1:' || :'migration_sha' || ',2:' || :'migration_sha_2' || ',3:' || :'migration_sha_3' || ',4:' || :'migration_sha_4' || ',5:' || :'migration_sha_5' || ',6:' || :'migration_sha_6' || ',7:' || :'migration_sha_7' || ',8:' || :'migration_sha_8' || ',9:' || :'migration_sha_9' || ',10:' || :'migration_sha_10' || ',11:' || :'migration_sha_11' || ',12:' || :'migration_sha_12' || ',13:' || :'migration_sha_13' || ',14:' || :'migration_sha_14' || ',15:' || :'migration_sha_15' || ',16:' || :'migration_sha_16' || ',17:' || :'migration_sha_17' || ',18:' || :'migration_sha_18' || ',19:' || :'migration_sha_19' AS at_v19 \gset
|
||||
\if :at_v19
|
||||
:'history' = '1:' || :'migration_sha' || ',2:' || :'migration_sha_2' || ',3:' || :'migration_sha_3' || ',4:' || :'migration_sha_4' || ',5:' || :'migration_sha_5' || ',6:' || :'migration_sha_6' || ',7:' || :'migration_sha_7' || ',8:' || :'migration_sha_8' || ',9:' || :'migration_sha_9' || ',10:' || :'migration_sha_10' || ',11:' || :'migration_sha_11' || ',12:' || :'migration_sha_12' || ',13:' || :'migration_sha_13' || ',14:' || :'migration_sha_14' || ',15:' || :'migration_sha_15' || ',16:' || :'migration_sha_16' || ',17:' || :'migration_sha_17' || ',18:' || :'migration_sha_18' || ',19:' || :'migration_sha_19' AS at_v19,
|
||||
:'history' = '1:' || :'migration_sha' || ',2:' || :'migration_sha_2' || ',3:' || :'migration_sha_3' || ',4:' || :'migration_sha_4' || ',5:' || :'migration_sha_5' || ',6:' || :'migration_sha_6' || ',7:' || :'migration_sha_7' || ',8:' || :'migration_sha_8' || ',9:' || :'migration_sha_9' || ',10:' || :'migration_sha_10' || ',11:' || :'migration_sha_11' || ',12:' || :'migration_sha_12' || ',13:' || :'migration_sha_13' || ',14:' || :'migration_sha_14' || ',15:' || :'migration_sha_15' || ',16:' || :'migration_sha_16' || ',17:' || :'migration_sha_17' || ',18:' || :'migration_sha_18' || ',19:' || :'migration_sha_19' || ',20:' || :'migration_sha_20' AS at_v20 \gset
|
||||
\if :at_v20
|
||||
\elif :at_v19
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v18
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v17
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v16
|
||||
\ir 0017_life_request_outcomes.sql
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v15
|
||||
\ir 0016_primitive_publication.sql
|
||||
\ir 0017_life_request_outcomes.sql
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v14
|
||||
\ir 0015_life_reservations.sql
|
||||
\ir 0016_primitive_publication.sql
|
||||
\ir 0017_life_request_outcomes.sql
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v13
|
||||
\ir 0014_probe_overdue.sql
|
||||
\ir 0015_life_reservations.sql
|
||||
@@ -121,6 +129,7 @@ SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname='evolution')
|
||||
\ir 0017_life_request_outcomes.sql
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v12
|
||||
\ir 0013_probe_incoming.sql
|
||||
\ir 0014_probe_overdue.sql
|
||||
@@ -129,6 +138,7 @@ SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname='evolution')
|
||||
\ir 0017_life_request_outcomes.sql
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v11
|
||||
\ir 0012_probe_handoff.sql
|
||||
\ir 0013_probe_incoming.sql
|
||||
@@ -138,6 +148,7 @@ SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname='evolution')
|
||||
\ir 0017_life_request_outcomes.sql
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v10
|
||||
\ir 0011_region_actions.sql
|
||||
\ir 0012_probe_handoff.sql
|
||||
@@ -148,6 +159,7 @@ SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname='evolution')
|
||||
\ir 0017_life_request_outcomes.sql
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v9
|
||||
\ir 0010_account_control.sql
|
||||
\ir 0011_region_actions.sql
|
||||
@@ -159,6 +171,7 @@ SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname='evolution')
|
||||
\ir 0017_life_request_outcomes.sql
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v8
|
||||
\ir 0009_serialized_authority.sql
|
||||
\ir 0010_account_control.sql
|
||||
@@ -171,6 +184,7 @@ SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname='evolution')
|
||||
\ir 0017_life_request_outcomes.sql
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v7
|
||||
\ir 0008_upgrade_barrier.sql
|
||||
\ir 0009_serialized_authority.sql
|
||||
@@ -184,6 +198,7 @@ SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname='evolution')
|
||||
\ir 0017_life_request_outcomes.sql
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v6
|
||||
\ir 0007_region_clones.sql
|
||||
\ir 0008_upgrade_barrier.sql
|
||||
@@ -198,6 +213,7 @@ SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname='evolution')
|
||||
\ir 0017_life_request_outcomes.sql
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v5
|
||||
\ir 0006_commit_lookup.sql
|
||||
\ir 0007_region_clones.sql
|
||||
@@ -213,6 +229,7 @@ SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname='evolution')
|
||||
\ir 0017_life_request_outcomes.sql
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v4
|
||||
\ir pre_v5_guard.sql
|
||||
\ir 0005_batch_decisions.sql
|
||||
@@ -230,6 +247,7 @@ SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname='evolution')
|
||||
\ir 0017_life_request_outcomes.sql
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v3
|
||||
\ir 0004_lineage_profile.sql
|
||||
\ir pre_v5_guard.sql
|
||||
@@ -248,6 +266,7 @@ SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname='evolution')
|
||||
\ir 0017_life_request_outcomes.sql
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v2
|
||||
\ir 0003_region_checkpoints.sql
|
||||
\ir 0004_lineage_profile.sql
|
||||
@@ -267,6 +286,7 @@ SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname='evolution')
|
||||
\ir 0017_life_request_outcomes.sql
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\elif :at_v1
|
||||
\ir 0002_region_fencing.sql
|
||||
\ir 0003_region_checkpoints.sql
|
||||
@@ -287,6 +307,7 @@ SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname='evolution')
|
||||
\ir 0017_life_request_outcomes.sql
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.sql
|
||||
\else
|
||||
\echo 'Unknown or changed migration history'
|
||||
DO $$ BEGIN RAISE EXCEPTION 'unknown or changed migration history'; END $$;
|
||||
@@ -312,6 +333,7 @@ SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname='evolution')
|
||||
\ir 0017_life_request_outcomes.sql
|
||||
\ir 0018_cellular_profile_admission.sql
|
||||
\ir 0019_cellular_action_records.sql
|
||||
\ir 0020_cellular_publication.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
|
||||
@@ -356,6 +378,8 @@ BEGIN
|
||||
('evolution.resolve_region_commit(evolution.u64,evolution.u64,uuid,bytea,bytea,bytea)'::regprocedure::oid),
|
||||
('evolution.find_region_action(evolution.u64,evolution.u64,uuid,evolution.u64,uuid,evolution.u64)'::regprocedure::oid),
|
||||
('evolution.find_region_action_record(evolution.u64,evolution.u64,uuid,evolution.u64,uuid,evolution.u64)'::regprocedure::oid),
|
||||
('evolution.publish_cellular_checkpoint(bytea,bytea,bytea)'::regprocedure::oid),
|
||||
('evolution.resolve_cellular_region_commit(evolution.u64,evolution.u64,uuid,bytea,bytea,bytea)'::regprocedure::oid),
|
||||
('evolution.open_probe(evolution.u64,evolution.u64,uuid,evolution.u64,uuid,bigint,bigint,bigint,evolution.u64)'::regprocedure::oid),
|
||||
('evolution.save_probe(evolution.u64,evolution.u64,uuid,evolution.u64,uuid,evolution.u64,bigint,bigint,bigint)'::regprocedure::oid),
|
||||
('evolution.prepare_probe_transfer(evolution.u64,evolution.u64,uuid,evolution.u64,uuid,evolution.u64,uuid,evolution.u64,bigint,bigint,bigint)'::regprocedure::oid),
|
||||
|
||||
Reference in New Issue
Block a user