paimon
paimon copied to clipboard
[Feature] Share BTree SST block cache across scans and avoid invalidating on close
Search before asking
- [x] I searched in the issues and found nothing similar.
Motivation
On master (055fe60215), repeated point lookups on large B-Tree SST files repeatedly read index/data blocks from remote storage because:
BTreeGlobalIndexer(BTreeGlobalIndexer.java:102-109) creates a new privateCacheManagerper instance, preventing cache reuse across scans.BlockCache.close()(BlockCache.java:100-102) unconditionally callscacheManager.invalidFile(filePath), immediately evicting all blocks loaded byBTreeIndexReader.BTreeIndexReadereagerly opens the underlyingSeekableInputStreameven when blocks could be served from cache.
Solution
- Support sharing a bounded
CacheManageracrossBTreeGlobalIndexerscans (keyed by cache size / high-priority ratio). - Allow
BlockCacheto skipinvalidFile(filePath)onclose()when backed by a shared cache (committed B-Tree SST files are immutable). - Open the underlying
SeekableInputStreamlazily only on cache miss.
Anything else?
No response
Are you willing to submit a PR?
- [x] I'm willing to submit a PR!