Report the progress of an active query

Aperta
#486 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
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
rust

Direzione di ricerca

Start with beacon-db/beacon-core/src/runtime.rs to trace how run_query creates and drops the stream, then read beacon-db/beacon-core/src/metrics.rs and beacon-db/beacon-file-formats/beacon-arrow-atlas/src/datafusion/metrics.rs for the live metrics. Coordinate the registry and partial-row design with issue #484 and the related cancellation work in #483. Done means active queries can be read and sampled for slow-query logs, with entries removed when streams drop.

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

Descrizione

effort-M enhancement rust

What is missing

Beacon holds no record of an active query. A slow query stays invisible until it ends.

Two questions have no answer today. What runs now? How far along is it?

The query store receives one row at the end of a query. A cancelled query records nothing. See #484.

The data already exists

This issue needs no new counter.

ExecutionPlanMetricsSet updates while the scan runs. The values are live.

AtlasScanMetrics already counts the work of an Atlas scan:

  • atlas_datasets_scanned counts the datasets a partition read.
  • atlas_datasets_pruned counts the datasets the statistics ruled out.
  • atlas_index_rows counts the datasets a pruning index covers.

The plan holds the total dataset count. create_physical_plan makes one entry per dataset.

So a reader can compute progress today. Example: 42 of 190 datasets, and 12 ruled out.

What is absent

A place to read the values from.

No caller reaches the physical plan after run_query returns. The plan lives inside the stream alone.

Steps

  1. Add a registry of active queries. Key it on the query id.
  2. Hold the start time, the user and the physical plan in each entry.
  3. Insert an entry when a query starts.
  4. Remove the entry when the stream drops.
  5. Add a read path for the registry. A SQL table function matches the existing style.
  6. Add a task that logs the slow queries. Log one line per query above an age limit.

Why a timer, and not the read path

A collection holds up to millions of datasets. An event per dataset floods the log.

Sample the registry on a timer instead. Set the age limit in config. 30 seconds is a reasonable default.

A second use

The registry gives cancellation a home.

Beacon holds no cancellation token today. A client cancels a query only by a disconnect. No caller can cancel a query by its id.

Hang a token on each entry. Issues #483 and #484 both need one.

Design overlap

Issue #484 must decide how the query store marks a partial row.

This issue must decide what the registry reports.

Sequence the two together. One decision covers both.

Files

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

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

beacon-db/beacon-file-formats/beacon-arrow-atlas/src/datafusion/metrics.rs

Related

#481, #483, #484

Issue #485 adds the query id to the logs. That id keys this registry too.

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.