Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

RFC: Ingester ack in Postgres; `failed/` only for bad submissions

Aperta
#2,124 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
postgresql, python
Ambito
backend, databases

Direzione di ricerca

Inizia tracciando ingest_submissions_parallel e monitor_submissions, quindi esamina transaction.atomic, assign_lab_ids, il counter_lock esistente e la gestione di writer.exitcode. Definisci lo schema e la concessione dei ruoli prima di implementare le scritture atomiche dei fatti e delle righe applicate, i riconoscimenti dello spool, l’interruzione dei tentativi e il comportamento di quarantena; il lavoro è completato quando i risultati indicati sono validi per ogni caso di errore.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The Problem

Valid submissions passed schema and log-excerpt upload. Database insertion then failed. The ingester moved the whole batch to failed/ — the directory for invalid data. That directory was cleaned up, so good data was treated as poison.

Rules

failed/ — invalid JSON and errors of the submission itself. Cases where retry cannot help.

DB insert / flush failure — files are not moved and nothing is acked. The spool is the retry queue; fact inserts are upserts, so a later attempt is safe.

Applied — a row in ingested_submissions, inserted in the same transaction.atomic() as the facts (assign_lab_ids moves into that transaction so "applied" is one boundary). The file is deleted only after that commit.

hash         text PK       -- sha256 of raw file bytes
file_name    text
_timestamp   timestamptz   -- `field_timestamp`

Scan deletes any file whose hash is already present, which covers a crash between commit and unlink.
Flush writes all entity buffers in one commit and acks exactly the hashes in it, so no file is finalized while its rows are still buffered.

Stop on stuck retry — one shared multiprocessing.Value("d") holds the last time a submission reached a terminal state, updated under the existing counter_lock on an apply commit and on a quarantine. Checked only while work is pending, in the poll loop of ingest_submissions_parallel and the monitor loop of monitor_submissions. If nothing has reached a terminal state for T, the process exits non-zero; files stay in the spool. Existing writer.exitcode handling stays for crashes; the timestamp covers hangs and persistent errors, which never raise.

If a file is kept on spool dir after for a long enough grace period of time, we can abort and raise an error on the ingester.

New table: GRANT the ingester role before shipping the writer.

Error we had Outcome
Insert exception Files stay, nothing in failed/, retried; process exits after T
Invalid JSON / bad submission That file → failed/
Successful commit Ack row, then file deleted
Lingua principale
Python
Stelle
9
Fork
31
Merge medio
5g 22h
PR unite (30g)
19

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di kernelci/dashboard

Tutte le issue di kernelci/dashboard

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.