From 92e0a21a5874952890cb410dbef5fbc70ff5d18e Mon Sep 17 00:00:00 2001 From: Trezy Date: Sat, 23 May 2026 15:36:15 -0500 Subject: [PATCH] fix: prevent backfill jobs from locking locking out pause/cancellation Signed-off-by: Trezy Signed-off-by: Trezy --- .../20260522000000_add_records_collection_indexed_at_index.sql | 2 ++ src/admin/backfill.rs | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 migrations/postgres/20260522000000_add_records_collection_indexed_at_index.sql diff --git a/migrations/postgres/20260522000000_add_records_collection_indexed_at_index.sql b/migrations/postgres/20260522000000_add_records_collection_indexed_at_index.sql new file mode 100644 index 0000000..6ac0175 --- /dev/null +++ b/migrations/postgres/20260522000000_add_records_collection_indexed_at_index.sql @@ -0,0 +1,2 @@ +CREATE INDEX IF NOT EXISTS idx_records_collection_indexed_at +ON records (collection, indexed_at DESC); diff --git a/src/admin/backfill.rs b/src/admin/backfill.rs index 4e1165d..0418ea4 100644 --- a/src/admin/backfill.rs +++ b/src/admin/backfill.rs @@ -681,7 +681,6 @@ async fn run_pipelined_resolve_and_fetch( let poll_job_id = Arc::clone(&job_id_arc); let poll_cancelled = Arc::clone(&cancelled); let pair = tokio::select! { - biased; result = rx.recv() => result, _ = async move { loop { -- 2.51.2