Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Feature] Prefetch the late-materialization payload ranges instead of reading them on demand

Chiusa
#341 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

Inizia tracciando PrefetchFileBatchReader::PreBufferRange(), ReadAheadCache::Init(), Read(), Reset() e Close(), quindi esamina le API pubbliche sotto include/paimon/. Segui il modo in cui LateMaterializingFileBatchReader determina gli intervalli del payload e il modo in cui vengono registrate le metriche della cache esistenti. Il lavoro è completato quando gli intervalli late vengono registrati e preriscaldati in modo sicuro tra i round, le registrazioni obsolete vengono eliminate, vengono rispettate le regole di concorrenza e sovrapposizione e le nuove metriche tengono conto dei byte registrati ed eliminati.

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

Descrizione

enhancement

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

Late materialization reads a data file in two passes: a probe pass over the predicate fields, then a payload pass over the remaining fields for the matched rows only. The shared read-ahead cache is fed once per read-range generation through PrefetchFileBatchReader::PreBufferRange(), before any read starts. At that point the payload pass cannot know which pages hold the matched rows — that depends on the probe result — so PreBufferRange() only reports the probe ranges (there was an explicit TODO for exactly this). The payload pass is therefore never prefetched: every payload read misses the cache and waits for its own underlying IO, serialized against the decode, on the pass that touches the wide columns.

Solution

Let a reader report byte ranges that only become known after reading has started, and let the shared cache register them mid-read.

  • New ReadAheadCache::AddRanges(ranges, expected_round) registers ranges into an already-initialized cache and is safe to call repeatedly and concurrently with Read(). It merges the new ranges into the disjoint, offset-ordered pending list, registering only the parts no registered range covers and dropping the overlap (the round that registered it is already fetching those bytes), then rebuilds the per-range cached flags so an already-fetched range is not fetched twice. The registered part is cut at a new CacheConfig knob late_range_size_limit (default 8 MiB, smaller than the 32 MiB range_size_limit) so a large pass is fetched by several concurrent requests rather than one long one; a new Warmup(from_offset) starts fetching from the first newly-registered range instead of from the head.
  • A registration round bounds the lifetime: every Init() opens a round identified by RegistrationRound(), and AddRanges() drops everything when expected_round is not the open round, so a pass that outlived its generation — the cache was reset for a new read-range generation, or released by Close() — registers nothing instead of prefetching bytes nobody reads. The round counter is monotonic across Reset() so a stale round is never mistaken for a new one.
  • New PrefetchFileBatchReader::PreBufferSink and SetPreBufferSink(): PrefetchFileBatchReaderImpl installs a sink on each sub-reader that tags the reported ranges with the current round, calls AddRanges, and warms up from the first new range. LateMaterializingFileBatchReader reports the payload ranges through the sink once the probe pass has refined the inner reader's target pages, and surfaces a failure to compute them (they come from the file metadata) rather than swallowing it.
  • New metrics read-ahead-cache.late.registered / .registered-bytes / .dropped / .dropped-bytes, counted after coalescing and splitting, so registered-bytes and dropped-bytes together account for every reported byte.

Anything else?

Adds public API under include/paimon/: PrefetchFileBatchReader::PreBufferSink / SetPreBufferSink() and CacheConfig::GetLateRangeSizeLimit() / SetLateRangeSizeLimit(). ReadAheadCache::AddRanges / RegistrationRound / Warmup(offset) and the new counter names live in the internal header. No storage format or protocol change.

Are you willing to submit a PR?

  • I'm willing to submit a PR!
Lingua principale
C++
Stelle
65
Fork
29
Merge medio
2g 4h
PR unite (30g)
78

Guida per i contributori

Apri la 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 apache/paimon-cpp

Tutte le issue di apache/paimon-cpp

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.