From 0bbeca8d8bb6434ba656d958ba21f1577379542a Mon Sep 17 00:00:00 2001 From: Brad Seiler Date: Mon, 9 Nov 2026 15:41:59 -0800 Subject: [PATCH] docs(db): explain invite repair recovery after lock timeout Co-authored-by: Honor Signed-off-by: Brad Seiler --- TESTING.md | 4 +++- scripts/maintenance/backfill_invite_revocations.sql | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/TESTING.md b/TESTING.md index b97b18d363..3d5c17de11 100644 --- a/TESTING.md +++ b/TESTING.md @@ -234,7 +234,9 @@ second run must keep zero and leave revocation timestamps and markers unchanged. The default two-minute statement timeout covers the entire repair invocation, not each batch. A timeout preserves committed batches, rolls back the current batch and skips the final query; it is not a successful zero check. Keep the -same writer controls in place and rerun. If scanning already repaired rows +same writer controls in place and rerun. A `lock_timeout` stop likewise keeps +committed batches; resolve lock contention and rerun under the same controls. +If scanning already repaired rows exhausts that budget, pass a larger finite budget, for example `psql -X -v ON_ERROR_STOP=1 -v invite_repair_timeout=10min -f scripts/maintenance/backfill_invite_revocations.sql`. Review fenced communities separately and keep their admission closed until they diff --git a/scripts/maintenance/backfill_invite_revocations.sql b/scripts/maintenance/backfill_invite_revocations.sql index f9deca5b52..b7c1172b4e 100644 --- a/scripts/maintenance/backfill_invite_revocations.sql +++ b/scripts/maintenance/backfill_invite_revocations.sql @@ -15,6 +15,8 @@ -- statement_timeout bounds the entire DO invocation, including all batches; -- COMMIT does not restart it. On timeout, committed batches remain repaired, -- the current batch rolls back, and ON_ERROR_STOP skips the final zero check. +-- A lock_timeout stop likewise keeps committed batches; keep admission closed +-- and rerun after resolving lock contention. -- Keep admission closed and rerun. If scanning the repaired prefix consumes -- the budget, choose a larger finite invocation budget with psql's -- -v invite_repair_timeout=10min (the default is 2min).