[Feature] Prefetch the late-materialization payload ranges instead of reading them on demand
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 38/100
- Type d'issue
- Fonctionnalité
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- cpp
- Domaine
- data-engineering, performance
Piste de recherche
Commencez par suivre PrefetchFileBatchReader::PreBufferRange(), ReadAheadCache::Init(), Read(), Reset() et Close(), puis examinez les APIs publiques sous include/paimon/. Suivez la manière dont LateMaterializingFileBatchReader détermine les plages de payload et dont les métriques de cache existantes sont enregistrées. Le travail est terminé lorsque les plages tardives sont enregistrées et préchauffées de manière sûre entre les différentes passes, que les enregistrements obsolètes sont supprimés, que les règles de concurrence et de chevauchement sont respectées et que les nouvelles métriques comptabilisent les octets enregistrés et supprimés.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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!
- Langage dominant
- C++
- Étoiles
- 65
- Forks
- 29
- Merge moyen
- 2 j 11 h
- PR mergées (30 j)
- 79
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/paimon-cpp
-
bug
apache/paimon-cpp#385 · 1 personne assignée ·
-
enhancement
apache/paimon-cpp#381 · 1 personne assignée ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 30/100
apache/paimon-cpp#375 · 1 personne assignée ·
-
enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 45/100
apache/paimon-cpp#361 · 1 personne assignée ·
-
enhancement
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
apache/paimon-cpp#325 · 1 personne assignée ·
Toutes les issues de apache/paimon-cpp
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Component: GLib
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
Mute ydb/tests/functional/dstool/test_canonical_requests.py.Test.test_group_take_snapshot in main Ouverteai_reviewed
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
ydb-platform/ydb#53974 · 3 commentaires ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
google/libultrahdr#485 ·