Record metrics for a cancelled stream query

Aperta
#484 1 commento 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
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
rust

Direzione di ricerca

Start with beacon-db/beacon-core/src/runtime.rs:237 and the stream wrapper CoalesceSqlStream, then trace how beacon-server/beacon-server/src/axum/client/query.rs stores query metrics. Decide how partial rows will be marked, record collected metrics when a stream is cancelled, and check that completed streams keep their existing behavior. Done means cancelled stream queries leave identifiable partial metrics in the query store and counters.

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

Descrizione

bug effort-S rust

Parent: #481

Describe the bug

The stream output records query metrics at stream end. A cancelled query never reaches that point.

The query store then holds no row for the query. The atlas_* counters are lost too.

A slow query that a client abandons leaves no trace.

Impact

These queries need diagnosis the most. A user reports a slow query. The query store holds nothing about it.

The two output routes differ here. run_query_to_file records metrics after the write. The code says so at runtime.rs:237.

Expected behavior

A cancelled query records the metrics it collected.

Open decision

The row is partial. A reader must not read it as a complete query.

Pick one option:

  1. Add a state column. Values: complete, cancelled.
  2. Add a boolean column for a partial row.
  3. Mark the row in an existing column.

Option 1 is clearer. It also costs a schema change in the query store.

Suggested fix

  1. Pick an option above.
  2. Record the metrics when the stream drops.
  3. Mark the row with the chosen column.

A Drop implementation on the stream wrapper is one way. CoalesceSqlStream already wraps the stream.

Keep the record step cheap. A drop runs on the runtime.

Files

beacon-db/beacon-core/src/runtime.rs

beacon-server/beacon-server/src/axum/client/query.rs

Scope

Every stream query. The format does not matter.

Lingua principale
Rust
Stelle
16
Fork
4
Merge medio
19h 58m
PR unite (30g)
39

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

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 maris-development/beacon

Tutte le issue di maris-development/beacon

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.