From 4c4ab367f4caba425f7a237f4dc7c5d7e10d3c2f Mon Sep 17 00:00:00 2001 From: dingo Date: Sat, 10 Oct 2026 19:35:45 -0400 Subject: [PATCH] Order reservation conflict check before refusal --- docs/engineering/VALIDATION.md | 6 ++++++ tools/ci/life-reservations-check.sql | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/engineering/VALIDATION.md b/docs/engineering/VALIDATION.md index 92cc906..d1daf3f 100644 --- a/docs/engineering/VALIDATION.md +++ b/docs/engineering/VALIDATION.md @@ -5733,3 +5733,9 @@ durable `existing_life` refusal and allocates its own identity. Updated the chec to assert the returned identity and rejection value, and aligned the reservation contract text with v17. PostgreSQL is unavailable in this Windows environment; the focused and full database checks await CI. + +The next run failed that assertion because the new request was first issued only +after the original reservation had been refused. Moved the first conflicting +request before that refusal, then kept the later call as an exact-retry check. +The latest SQL adjustment has not yet run in CI; PostgreSQL remains unavailable +locally. diff --git a/tools/ci/life-reservations-check.sql b/tools/ci/life-reservations-check.sql index e3cce33..f49895b 100644 --- a/tools/ci/life-reservations-check.sql +++ b/tools/ci/life-reservations-check.sql @@ -18,6 +18,9 @@ SELECT 1 / ((:life_identity = 1)::int); -- Capture parameters for PL/pgSQL exception assertions without string interpolation. SELECT set_config('test.holder', :'lease_holder', false), set_config('test.epoch', :'lease_epoch', false); +SELECT * FROM evolution.reserve_primitive_life(9750,1,:'lease_holder',:lease_epoch, + '11111111-1111-1111-1111-111111111111',:control_generation,11,1) \gset +SELECT 1 / ((:life_identity = 2 AND :rejection = 4)::int); DO $$ BEGIN BEGIN PERFORM evolution.reserve_primitive_life(9750,1,current_setting('test.holder')::uuid, @@ -41,7 +44,7 @@ SELECT 1 / ((evolution.reject_primitive_life(9750,1,:'lease_holder',:lease_epoch '11111111-1111-1111-1111-111111111111',1,10,2::smallint) = 1)::int); SELECT * FROM evolution.reserve_primitive_life(9750,1,:'lease_holder',:lease_epoch, '11111111-1111-1111-1111-111111111111',1,11,1) \gset --- The conflicting request keeps its own allocated identity and immutable refusal. +-- Exact retry keeps the conflict's allocated identity and immutable refusal. SELECT 1 / ((:life_identity = 2 AND :rejection = 4)::int); SELECT * FROM evolution.reserve_primitive_life(9750,1,:'lease_holder',:lease_epoch, '11111111-1111-1111-1111-111111111111',1,10,1) \gset