mirror of
https://github.com/block/buzz.git
synced 2026-11-24 18:21:59 +00:00
fix(db): make invite repair run budget configurable
Retain the finite default and explain timeout recovery across committed batches so large repairs can finish with a reviewed invocation budget. Co-authored-by: Honor <e0bf479eeebe47dde1e35705212a4df70616a7bc834d907ddfb18cf0405f8b1b@seiler-test.communities.public.builderlabstaging.xyz> Signed-off-by: Brad Seiler <seiler@squareup.com>
This commit is contained in:
@@ -12,9 +12,19 @@
|
||||
-- before clearing legacy_admission on every invite row. Skipped communities
|
||||
-- retain the marker and remain fail-closed until a later run. The script is
|
||||
-- idempotent; rerun it after a failure.
|
||||
-- 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.
|
||||
-- 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).
|
||||
\set ON_ERROR_STOP on
|
||||
\if :{?invite_repair_timeout}
|
||||
\else
|
||||
\set invite_repair_timeout 2min
|
||||
\endif
|
||||
SET lock_timeout = '5s';
|
||||
SET statement_timeout = '2min';
|
||||
SET statement_timeout = :'invite_repair_timeout';
|
||||
|
||||
DO $$
|
||||
DECLARE
|
||||
|
||||
Reference in New Issue
Block a user