[Feature] Prefetch the late-materialization payload ranges instead of reading them on demand
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 38/100
- Tipo de issue
- Funcionalidade
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- cpp
- Domínio
- data-engineering, performance
Direção de pesquisa
Comece rastreando PrefetchFileBatchReader::PreBufferRange(), ReadAheadCache::Init(), Read(), Reset() e Close(), depois inspecione as APIs públicas em include/paimon/. Acompanhe como LateMaterializingFileBatchReader determina os intervalos de payload e como as métricas de cache existentes são registradas. O trabalho estará concluído quando os intervalos tardios forem registrados e aquecidos com segurança entre as rodadas, os registros obsoletos forem descartados, as regras de concorrência e sobreposição forem mantidas e as novas métricas contabilizarem os bytes registrados e descartados.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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!
- Linguagem predominante
- C++
- Estrelas
- 65
- Forks
- 29
- Merge médio
- 2d 13h
- PRs com merge (30d)
- 79
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de apache/paimon-cpp
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
apache/paimon-cpp#389 ·
-
enhancement
apache/paimon-cpp#381 · 1 responsável ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 30/100
apache/paimon-cpp#375 · 1 responsável ·
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 45/100
apache/paimon-cpp#361 · 1 responsável ·
-
enhancement
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
apache/paimon-cpp#325 · 1 responsável ·
Todas as issues de apache/paimon-cpp
Issues semelhantes
-
[CI] Nightly Clang build broken: structured binding captured in a lambda in FileDataSource.cpp Abertabug build
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 91/100
facebookincubator/velox#19194 ·
-
JIT-compiled number -> Decimal conversion silently overflows instead of raising DECIMAL_OVERFLOW Abertafuzz
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
ClickHouse/ClickHouse#122114 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
-
module/agent platform/macos type/bug/regression
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
-
enhancement PyCDE
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100