Repository navigation
[core] Add opt-in node-shared disk block cache - #1175
Merged
Merged
Conversation
XiaoHongbo-Hope
force-pushed
the
codex/shared-disk-cache
branch
2 times, most recently
from
October 20, 2026 10:01
84e2489 to
b79f0ef
Compare
XiaoHongbo-Hope
marked this pull request as ready for review
October 20, 2026 10:03
XiaoHongbo-Hope
force-pushed
the
codex/shared-disk-cache
branch
from
October 20, 2026 14:24
f467817 to
a8c8014
Compare
XiaoHongbo-Hope
force-pushed
the
codex/shared-disk-cache
branch
from
October 20, 2026 14:38
a8c8014 to
c2e89b1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add opt-in
local-cache.shared=truefor cooperating reader processes on onenode. The existing process-local memory/disk cache remains the default.
This shares raw immutable file blocks, not parsed Parquet metadata or decoded
Arrow values. It can be enabled by native SDK callers passing catalog options:
Implementation
matching capacities for participating processes.
concurrent cache hits; exclusive locks serialize publication, accounting,
eviction, and invalidation. Striped download locks coalesce concurrent misses,
including full/range reads. Read/publication contention with an exclusive
cache operation is bounded and falls back to the original source.
processes; interrupted accounting is recovered before another publication.
this fence before changing storage and holds the exclusive gate across the
storage operation, so an uncertain rename result cannot expose stale blocks.
Invalidation is intentionally directory-wide, even for one logical path.
are removed; process-local file-size caching is bypassed in shared mode.
dirty, missing, malformed, or over-capacity accounting triggers recovery.
Scope / draft review questions
This is a draft for design review, not a production rollout recommendation.
measurement. Hits run concurrently, but publication and invalidation still use
the directory-wide exclusive gate.
writer flush/close, and streaming shutdown. Storage may already have changed
when those errors are reported; callers must not reuse paths until invalidation
succeeds. Rename instead waits for a mandatory pre-mutation fence; cleanup after
generation rotation is recoverable and does not make a successful rename appear
to fail.
inherited live runtimes/caches after
fork.hazard after fork. This feature does not claim to fix that issue.
in-flight block are outside the encoded-block budget.
Validation
Rust 1.94, macOS:
The cache-filtered suite passes 133 tests on the proposed source, including
the separate-process tests below. Formatting and whitespace checks pass.
cargo +1.94.0 test -p paimon --lib cache \ --no-default-features --features storage-fs,storage-memory cargo +1.94.0 fmt --all -- --check git diff --checkTests cover separate executable processes sharing one source download,
CachedFileReader range/full reads, process termination releasing locks,
cross-process invalidation fencing stale readers, capacity mismatch, corruption,
and interrupted accounting recovery. Added regressions cover concurrent cache
hits under shared directory locks, malformed-generation repair, and rename
waiting for its pre-mutation fence without exposing a stale destination. Existing
coverage also includes invalidation lock timeout and filesystem failure, FileIO
file/directory deletion followed by retry and recreation, repeated streaming
shutdown failures, and eight independent worker startups on 2,000 blocks
asserting zero recovery scans. This is a functional test, not a production-scale
startup throughput benchmark. No production tables or customer programs are
modified.