Custom queue-storage schema: reject runtime slot counts that differ from the installed ring

Aperta
#689 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
postgresql, rust
Ambito
backend, databases

Direzione di ricerca

Start by tracing install_queue_storage_substrate and QueueStorage::new, then find how startup or prepare_schema reads the three *_ring_state.slot_count values. Check the runtime paths named in the issue, including complete_receipt_runtime_batch_fast, both receipt-rescue loops, and oldest_initialized_claim_slot_tx. Done means startup rejects mismatched configured and installed counts and reports both values.

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

Descrizione

A runtime on a custom queue-storage schema can be configured with different ring slot counts from the ones the schema was installed with, and nothing rejects it.

How it happens. install_queue_storage_substrate seeds {queue,lease,claim}_ring_state.slot_count with ON CONFLICT (singleton) DO NOTHING, so preparing an existing schema with different counts keeps the installed counts without error. Rotation then follows the installed slot_count, while several runtime paths bound slots by the configured count:

  • complete_receipt_runtime_batch_fast maps the claim slot through ring_slot_index(.., claim_slot_count(), ..), so a claim in a slot at or above the configured count fails completion with invalid claim ring slot N.
  • Both receipt-rescue loops iterate 0..claim_slot_count(), so claims in higher slots are never rescued.
  • oldest_initialized_claim_slot_tx filters slots to < claim_slot_count().

With fewer configured than installed slots, jobs claimed into the higher slots can fail to complete or stay stranded after a worker dies. The default awa schema is not affected: both the installer and QueueStorage::new force default slot counts there.

Proposed fix. At startup (or in prepare_schema), read the three *_ring_state.slot_count values and refuse to run when the configured counts differ, naming both values. Admin reads already use installed slot numbers (#665, #688).

Lingua principale
Rust
Stelle
37
Fork
8
Merge medio
14h 16m
PR unite (30g)
244

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 hardbyte/awa

Tutte le issue di hardbyte/awa

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.