Query logs carry no query id and no info events

Aperta
#485 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à
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/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 at the query ID creation point, then trace how the result stream is consumed in beacon-server/beacon-server/src/axum/client/query.rs and how Worker::prefetch spawns dataset opens. Review related issues #481 and #482 for the overlapping spawn change. Done means query start and end logs share the client-visible query ID, include the requested fields, and cover the stream and spawned work without per-batch or per-chunk events.

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

Descrizione

effort-S enhancement nd-pipeline rust

What is missing

A query produces no log line at the default level. The default level is info.

run_query holds no info! event. The query handler holds none either.

The logs also hold no query id. run_query makes the id at runtime.rs:99. No log event records it.

The client reads the id from the x-beacon-query-id header. No log line matches that id.

Why this matters

The Atlas read path logs real numbers at debug level. Three examples:

  • atlas create_physical_plan reports the collection count and the dataset count.
  • atlas infer_schema reports the field count.
  • AtlasSource morsel scan reports the datasets and the partitions.

No reader can attribute these lines to a query.

Two queries run at the same time. Their lines interleave. Nothing separates them.

Current state

The codebase holds one span. See runtime.rs:93:

#[tracing::instrument(skip(self, query, identity))]

The attribute skips every argument. So the span carries no field. It adds only a function name.

No other span exists. The codebase holds no info_span! call.

Steps

  1. Make an info_span! after run_query makes the query id.
  2. Record the id, the user and the query kind on the span.
  3. Attach the span to the result stream. Use tracing::Instrument.
  4. Add an info! event when a query starts.
  5. Add an info! event when a query ends. Record the duration, the rows and the bytes.

Why step 3 matters

The setup ends before the scan runs. A client pulls batches after run_query returns.

A span on the function alone covers none of the read path.

One risk

Worker::prefetch starts each dataset open with tokio::spawn. A spawned task does not inherit the current span.

Instrument that task with Span::current(). Without this step the open logs stay orphaned.

Issue #482 changes the same spawn. Do both in one change.

Do not

Do not log per chunk. Do not log per batch.

A collection holds up to millions of datasets. Such an event floods the log.

The crate docs already state this rule. A skipped column logs at debug for the same reason.

Files

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

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

beacon-db/beacon-file-formats/beacon-nd-array/src/arrow/morsel.rs

Related

#481, #482

Issue #486 covers the progress of an active query. This issue covers the logs of one query.

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.