Measure connection soft delete on a large connection; batch it or move it to the pipeline if needed
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- docker, postgresql, python, typescript
- Ambito
- backend, data-engineering, database
Direzione di ricerca
Read the D3 plan at docs/superpowers/plans/2026-12-03-issue-219-app-db-handling.md and app/src/lib/connections/deletion.ts, then inspect the Docker load harness and pipeline lock monitoring described in the issue. Measure the DELETE request and UPDATE with at least 1M ingest_files rows, recording the row count, duration, query plan, and blocked pipeline slots. Use those results to choose the documented timeout or batching/pipeline change, then meet the listed verification criteria.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Spec section
None. Follow-up from #219 (whole-repo review, 2026-11-29); the design note is the plan's "D3 revision".
Plan
docs/superpowers/plans/2026-12-03-issue-219-app-db-handling.md (D3, "Revised 2026-12-04"). This follow-up needs its own plan only if the measurement says to change the code.
Depends on
#219. It adds the bounds this issue measures. Labelled blocked until #219 merges.
Task
#219 gives every app query a 30 s statement_timeout. One transaction is exempt with a bounded limit: softDeleteConnection in app/src/lib/connections/deletion.ts sets
SET LOCAL statement_timeout = '10min';
SET LOCAL lock_timeout = '10s';
Its first statement updates every stac_higher.ingest_files row ingested through the connection (reference_removed_at = now(), joined through collection_connections; indexed on association_id). The 10-minute figure is a guess. Nobody has measured how long this takes on a large connection.
- Measure. On the Docker stack, seed one connection with a realistic large ingest history: at least 1M
ingest_filesrows across its associations, using the load harness (pipeline.loadgen --label <id>, torn down afterwards). TimeDELETE /api/connections/<id>and the UPDATE alone (EXPLAIN (ANALYZE, BUFFERS)). Record row count, duration and plan. - Measure the effect on the pipeline. While the delete runs, check whether ingest jobs for that connection block (
pg_locks/pg_stat_activitywait_event_type = 'Lock') and how manyWORKER_CONCURRENCYslots they hold. - Decide, based on the numbers:
- Comfortably under 30 s at the largest realistic size: drop the exemption and use the pool default.
- Under the bound but long enough to hold pipeline slots, or above it: batch the UPDATE (e.g.
ctid/key ranges of 10k rows, each its own short statement; the connection row itself is still soft-deleted last, in one transaction), or move the marking to the pipeline as a request row it drains (the app→pipeline pattern, ADR 0004). - The HTTP request also outlasting the load balancer's timeout is a reason to prefer the pipeline route: today the user can see a failure for a delete that completed.
Related but out of scope: the pipeline's own ingest_files updates (services/pipeline/src/pipeline/ingest/repo.py) set no statement_timeout or lock_timeout, which is why a long app-side lock holds their worker slots. If step 2 shows that matters, file it separately.
Acceptance criteria
- The measurements (row count, duration, plan, blocked pipeline slots) are recorded in this issue or in
docs/ISSUES.md. - One of: the exemption is removed; the bound is changed with the measurement cited in the code comment; or the UPDATE is batched or moved to the pipeline, with tests (
connections-deletion.test.ts, plus pytest if the pipeline changes). npm run verifygreen (anduv run pytest+uv run ruff check .if the pipeline is touched).
Files in scope
app/src/lib/connections/deletion.ts
app/src/__tests__/connections-deletion.test.ts
docs/ISSUES.md
services/pipeline/src/pipeline/… (only if the work moves to the pipeline)
Lead-only steps
The whole measurement: Docker stack plus load harness (singletons).
Migration number reserved
None, unless the work moves to the pipeline as a request table (then reserve one and add migration).
- Lingua principale
- Python
- Stelle
- 0
- Fork
- 2
- Merge medio
- 8h 26m
- PR unite (30g)
- 47
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TechTraverse/stac-higher
-
ci
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
TechTraverse/stac-higher#261 ·
I maintainer di solito rispondono entro 1 giorno
-
ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
TechTraverse/stac-higher#258 ·
I maintainer di solito rispondono entro 1 giorno
-
Error messages hide the server's reason: users see only '400 Bad Request'Forse già presa @aman-code-io l’ha presa 3 giorni fa. Apertabug good first issue ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
TechTraverse/stac-higher#232 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
TechTraverse/stac-higher#225 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
TechTraverse/stac-higher#216 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di TechTraverse/stac-higher
Issue simili
-
docs(contributing): the two things that silently block a PRForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaavailable documentation good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 95/100
Nixitov/Riptide-Native#944 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
JTHCode/secretguard#24 ·
I maintainer di solito rispondono entro 1 giorno
-
area: middleware documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
omarelshamy25x/shamy-hijri#63 ·
I maintainer di solito rispondono entro 1 giorno