Queue storage: cancel_by_unique_key without a queue still reads every retained receipt claim
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 47/100
Línea de trabajo
Start by reading the unscoped cancel_by_unique_key and cancel_by_unique_key_tx paths, open_receipt_running_claims_sql, and the existing test_queue_storage_cancel_by_unique_key_reads_live_work_only test. Compare the three proposed approaches against the oldest-nonterminal semantics and the 0.7 partition migration cost. Done means the extended test shows rows read stay flat as other queues' backlogs and retained claims grow, without changing which job is selected.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Follow-up to #585 / #586.
With a queue, admin::cancel_by_unique_key / cancel_by_unique_key_tx now start from that queue's ready rows holding the key. They check only those jobs for being available, leased or on an open receipt claim, and answer from the deferred_jobs key index when the queue has no such row. That cost follows the queue's own rows.
Without a queue (keys inserted without by_queue), the lookup still:
- walks every lane's available rows from its claim cursor;
- reads every open receipt claim (
open_receipt_running_claims_sql) before filtering by key.
The second part grows with claim-ring retention. A long-running job keeps the oldest claim slot from pruning, so row-local claims from completed jobs pile up behind it.
Measurement
Default awa schema on PostgreSQL 16, with 180,200 retained ready rows and 120,300 retained row-local claims in other queues. The lookup was timed through cancel_by_unique_key_tx, rolled back:
| p50 | |
|---|---|
| 0.6.9 lookup (any key) | 2.8 s |
| Pre-fix 0.6.10 lookup with a queue (reads the claim ring like the unscoped path) | 9.7 s |
| Key-first lookup with a queue: missing key | 1.7 ms |
| Key-first lookup with a queue: cancel a scheduled job | 11 ms |
| Key-first lookup with a queue: cancel an available job | 20 ms |
Unscoped lookups still behave like the pre-fix row.
Options
awa.job_unique_claimsas a fast path. Look upjob_idbyunique_key, then confirm it with a per-job state check.- As #585 notes, it can't replace the lookup. A claim exists only while its job's state is inside its
unique_statesmask, and the API promises the oldest nonterminal job holding the key. - So a hit can return a job when no live job outside the mask can share the key; a miss still needs the fallback.
- It helps the common default mask, but not a missing key.
- As #585 notes, it can't replace the lookup. A claim exists only while its job's state is inside its
- A partial index on
ready_entries (unique_key) WHERE unique_key IS NOT NULL. With it, an unscoped lookup can start from the key the way a scoped one starts from the queue.- It costs every unique enqueue and needs an upgrade path for existing partitions (0.7 migration).
- Leave unscoped lookups as they are and document the cost. Point callers at
by_queuekeys or cancel-by-id for latency-sensitive paths.
Done when
An unscoped lookup's rows read stay flat as other queues' backlogs and retained claims grow (extend test_queue_storage_cancel_by_unique_key_reads_live_work_only), and the oldest-nonterminal semantics are unchanged.
- Lenguaje dominante
- Rust
- Estrellas
- 37
- Forks
- 8
- Merge medio
- 14 h 16 min
- PR fusionados (30 d)
- 244
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de hardbyte/awa
-
feature
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 18/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
0.6.19 release checklistAbiertooperational
Dificultad 5/5 Más de una semana Aptitud para principiantes 8/100
hardbyte/awa#861 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
hardbyte/awa#841 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de hardbyte/awa
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
jelmer/buildlog-consultant#364 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
solutionscay/skiff#310 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
valkey-io/valkey-large-object#222 ·
Los mantenedores suelen responder en 1 día
-
[优化]数据库表清单这个地方希望增加一个Ctrl+A全选的功能Abiertobug user-priority/P1
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día