Lock-order model: split lane resources and model promotion, batch moves and aging

Aperta
#681 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à
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
postgresql, rust
Ambito
backend, databases

Direzione di ricerca

Start with correctness/storage/AwaStorageLockOrder.tla and trace the resource definitions and BatchReadyLaneMovePlan against move_ready_batch_fields_tx, per-lane promotion, and physical priority aging. Then inspect QueueStorage::age_waiting_priorities and the promotion lock-timeout behavior. Done means the model distinguishes claim-head and enqueue-lane locks, includes the missing plans, and re-checks deadlock freedom; the issue also proposes bounding aging’s lane wait.

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

Descrizione

0.6.14 changes several lock paths that correctness/storage/AwaStorageLockOrder.tla doesn't distinguish. A review found no new waits-for cycle, but the model can't show that today.

Model gaps

  • LaneResource(q, p) merges the claim-head row and the enqueue-lane advisory lock into one resource, so plans that take one but not the other, or both in a fixed order, can't be told apart.
  • There are no plans for:
    • per-lane promotion, which takes the enqueue lane and deferred_jobs rows under a short lock_timeout;
    • batch ready moves (move_ready_batch_fields_tx), which lock claim heads and then enqueue lanes;
    • physical priority aging, which locks claim heads in sorted order and then destination enqueue lanes.
  • The BatchReadyLaneMovePlan comment says the claim-head row is not locked by that path. move_ready_batch_fields_tx does lock it.

Related runtime concern

QueueStorage::age_waiting_priorities holds claim-head rows FOR UPDATE, with no lock timeout, while it waits on destination enqueue-lane locks that producers hold. Claimers skip those lanes for the whole wait. That's the stall pattern 0.6.14 removed from promotion. Maintenance doesn't run physical aging on queue storage, so only direct API callers reach it.

Proposal

  • Split LaneResource into claim-head and enqueue-lane resources, and add plans for promotion, batch moves and aging. Then re-check deadlock freedom.
  • Give age_waiting_priorities the same bounded lane wait that promotion uses.
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.