Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đã đóng
#341 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
38/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp

Hướng nghiên cứu

Bắt đầu bằng cách truy vết PrefetchFileBatchReader::PreBufferRange(), ReadAheadCache::Init(), Read(), Reset() và Close(), sau đó kiểm tra các API công khai bên dưới include/paimon/. Theo dõi cách LateMaterializingFileBatchReader xác định các phạm vi payload và cách các chỉ số cache hiện có được ghi nhận. Công việc được hoàn tất khi các phạm vi late được đăng ký và làm nóng an toàn qua các vòng, các đăng ký cũ được loại bỏ, các quy tắc về đồng thời và chồng lấp được tuân thủ, và các chỉ số mới tính đến số byte đã đăng ký và bị loại bỏ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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!
Ngôn ngữ chính
C++
Star
65
Fork
29
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
78

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/paimon-cpp

Tất cả issue của apache/paimon-cpp

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.