Supported API to change a queue's enqueue_shards, picked up by running producers
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
Direzione di ricerca
Start with QueueStorage::prepare_queue, QueueStorage::enqueue_shards_cache, and shard_for_enqueue, then read the sharding section in docs/configuration.md and the linked operations skill. Trace how queue striping maps a logical queue to physical queues and how lane provisioning interacts with queue_meta. Done means the API and CLI behavior, producer refresh behavior or documented limitation, tests for PostgreSQL 17 and 18, documentation, changelog, and 0.6 backport meet the listed criteria.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Changing a queue's enqueue_shards today means hand-writing SQL against awa.queue_meta, and the change does not reach running producers until they restart. Operators fill the gap with ad-hoc SQL against lane internals (head tables, ensure_lane_sequences, lane advisory-lock keys), which is brittle across releases.
Gaps
- No supported operation sets the shard count. The documented path is an
INSERT … ON CONFLICTupsert intoawa.queue_meta(configuration).QueueStorage::prepare_queue/awa storage prepare-queueprovisions lanes but does not changequeue_meta, so provisioning and switching are two steps an operator has to order correctly. The upsert also needs the physical queue names when queue striping is in use, whichprepare_queuealready handles for its own step. - Running producers keep the shard count they first read.
QueueStorage::enqueue_shards_cacheis filled lazily byshard_for_enqueueand cleared only byreset(). After a change, Rust producers keep enqueueing with the old count until the process restarts, while enqueues through the SQL insert functions readqueue_metaper statement and switch at commit. Raising and lowering both behave this way. The docs say lowering "is safe at any time" but don't mention the restart. - On 0.6.x before the
definer_lane_provisioningpatch, raising the count without provisioning first is unsafe with more than one runtime role. The first producer or maintenance leader to touch a new shard creates its lane sequences as its own role, without grants for the other runtime roles. v053 on 0.7 and the 0.6.14 patch fix this; the API below should not rely on callers knowing it.
Proposal
- A Rust API, e.g.
QueueStorage::set_enqueue_shards(pool, queue, shards), taking the logical queue name. In one transaction it validates1..=64, provisions every priority × shard lane for each physical queue when raising, and upsertsqueue_metafor each physical queue. No producer can then see the new count before its lanes exist. Lowering needs no provisioning. - A CLI command for the same operation, e.g.
awa storage set-enqueue-shards --queue <q> --shards <n>(or--setonprepare-queue), and a Python binding ifprepare_queueis exposed there. - Running producers pick up the new count within a bounded interval without a restart. That means a refresh with a TTL, or reusing an existing periodic refresh, as long as it adds no per-enqueue query. If that isn't practical, document the restart requirement for both raising and lowering.
Done when
- Tests on PostgreSQL 17 and 18 cover:
- an atomic raise, where no enqueue lands on an unprovisioned shard;
- idempotent re-runs;
- lowering;
- a running producer switching shard count without a restart (or the documented limitation);
- striped queues.
docs/configuration.md, the CHANGELOG and theawa-operationsskill describe the API in place of the raw upsert.- Backported to the 0.6 line.
- 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
- 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 hardbyte/awa
-
feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 18/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
0.6.19 release checklistApertaoperational
Difficoltà 5/5 Più di una settimana Idoneità per principianti 8/100
hardbyte/awa#861 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
hardbyte/awa#841 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di hardbyte/awa
Issue simili
-
Mobile release verification reports missing build inputs with a custom Cargo target directoryApertabug good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
getsotto/sotto-authenticator#139 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
registrystack/registry-stack#2924 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
foundry-rs/starknet-foundry#4733 ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100