[Feature] Prefetch the late-materialization payload ranges instead of reading them on demand
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 38/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- cpp
- Bereich
- data-engineering, performance
Rechercherichtung
Beginne damit, PrefetchFileBatchReader::PreBufferRange(), ReadAheadCache::Init(), Read(), Reset() und Close() nachzuverfolgen, und untersuche anschließend die öffentlichen APIs unter include/paimon/. Verfolge, wie LateMaterializingFileBatchReader Payload-Bereiche bestimmt und wie die vorhandenen Cache-Metriken erfasst werden. Die Aufgabe ist abgeschlossen, wenn Late-Ranges sicher über mehrere Runden hinweg registriert und vorgewärmt werden, veraltete Registrierungen entfernt werden, die Regeln für Nebenläufigkeit und Überlappungen eingehalten werden und die neuen Metriken registrierte und verworfene Bytes erfassen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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 withRead(). 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 newCacheConfigknoblate_range_size_limit(default 8 MiB, smaller than the 32 MiBrange_size_limit) so a large pass is fetched by several concurrent requests rather than one long one; a newWarmup(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 byRegistrationRound(), andAddRanges()drops everything whenexpected_roundis not the open round, so a pass that outlived its generation — the cache was reset for a new read-range generation, or released byClose()— registers nothing instead of prefetching bytes nobody reads. The round counter is monotonic acrossReset()so a stale round is never mistaken for a new one. - New
PrefetchFileBatchReader::PreBufferSinkandSetPreBufferSink():PrefetchFileBatchReaderImplinstalls a sink on each sub-reader that tags the reported ranges with the current round, callsAddRanges, and warms up from the first new range.LateMaterializingFileBatchReaderreports 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, soregistered-bytesanddropped-bytestogether 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!
- Vorherrschende Sprache
- C++
- Sterne
- 65
- Forks
- 29
- Ø Merge
- 2 T. 11 Std.
- Gemergte PRs (30 T.)
- 79
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus apache/paimon-cpp
-
bug
apache/paimon-cpp#385 · 1 zugewiesene Person ·
-
enhancement
apache/paimon-cpp#381 · 1 zugewiesene Person ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
apache/paimon-cpp#375 · 1 zugewiesene Person ·
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 45/100
apache/paimon-cpp#361 · 1 zugewiesene Person ·
-
enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
apache/paimon-cpp#325 · 1 zugewiesene Person ·
Alle Issues in apache/paimon-cpp
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
google/libultrahdr#485 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
godotengine/godot#123776 ·
-
bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 60/100
-
good first issue
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
-
good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
ros2/common_interfaces#344 ·