Repository navigation
[core] Cache catalog tag lookups across native reads - #1565
Open
XiaoHongbo-Hope wants to merge 1 commit into
Open
XiaoHongbo-Hope wants to merge 1 commit into
XiaoHongbo-Hope wants to merge 1 commit into
Conversation
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.
Purpose
Closes #1564.
Repeated native reads with
scan.tag-nameresolve the same REST tag during planning/reading, even when callers reuse a table. Add an opt-inCachingCatalogso those reads can reuse successful GetTag responses. The native bridge regression performs three scans of the same tagged table and asserts a single GetTag HTTP request with identical returned rows.Brief change log
CachingCatalog, delegating other operations and sharing its bounded tag cache with REST-backed tables returned byget_table/load_table.Table.from_rest_response. The latter retains a table-scoped cache because the Python bridge can bypass CatalogFactory.Catalog::invalidate_tablewith a default no-op implementation.cache.enabled=true,cache.expire-after-write=1 min, andcache.tag.max-num=1024. Caching defaults to disabled; zero TTL or capacity also disables it.Keys include database, table, branch and tag and are scoped to a catalog instance. External mutations may remain unseen until expiration. This does not pin a read view, extend snapshot retention, or cache GetTable/query authorization. Existing behavior remains unchanged with caching disabled.
Tests
cargo test -p paimon --lib catalog::caching_catalog::tests: 5 passed.cargo test -p paimon --test rest_catalog_test tag: 9 passed, including four new cache integration tests and existing lifecycle/authorization tests.cargo clippy -p paimon --lib -- -D warnings: passed.cargo fmt --all -- --checkandgit diff --check: passed.cargo check -p pypaimon_rustwithPYO3_PYTHONpointing to Python 3.11: passed.The complete workspace test suite has not been run locally.
API and Format
Adds the Rust
CachingCatalogwrapper and a defaultCatalog::invalidate_tablehook. No storage format changes or Python pin API.Documentation
Document configuration, native table reuse, expiration/invalidation, and retention/freshness boundaries in the Python binding guide.