[refactor](fe) Refactor external metadata cache with MetaCacheEntry#65126
Draft
wenzhenghu wants to merge 7 commits into
Draft
[refactor](fe) Refactor external metadata cache with MetaCacheEntry#65126wenzhenghu wants to merge 7 commits into
wenzhenghu wants to merge 7 commits into
Conversation
- fix MetaCacheEntry publication races for manual miss load and async refresh - reduce MetaCacheEntry stripe overhead by using single-key stripes for names caches and a configurable default for object caches - make NameCacheValue snapshots effectively immutable against external Pair mutation - align ExternalDatabase table object cache construction with the normal non-removal-listener path - add FE unit tests for replay exact-hit, mode 2 lookup, names-only invalidation, id map updates, system database paths, and atomic cache publication - update the JDBC regression case after removing the obsolete manual miss load config
- source database id map updates from db.getId() in updateDatabaseCache - cover the migrated tableNames refresh path in the JDBC regression case - reuse invalidateKey() for invalidateAll() and invalidateIf() so bulk invalidation shares the same per-key publication coordination - simplify asyncReload() to a best-effort generation-aware refresh path - strengthen MetaCacheEntry FE unit tests for second-generation checks, async refresh completion, bulk invalidate combinations, and direct executor refresh
### What problem does this PR solve? Issue Number: None Related PR: None Problem Summary: The negative lookup behavior of the external meta cache refactor needed further alignment across the init and replay paths. The intended semantics are: a cold names miss should load the names snapshot only once; a hot-snapshot miss should reload names only when enable_external_meta_cache_name_miss_refresh is enabled; replay misses should remain non-blocking and must not perform synchronous load-through; and the miss-refresh switch must take effect dynamically on an existing catalog or database instance instead of only at construction time. This change aligns the init object-loader paths, preserves cache-only replay miss semantics on hot snapshots, and updates the replay comments to reflect that hot cache hits may still schedule asynchronous refresh-after-write without blocking the caller. ### Release note None ### Check List (For Author) - Test: Unit Test - Behavior changed: No - Does this need documentation: No
### What problem does this PR solve? Issue Number: None Related PR: None Problem Summary: A local development design draft was mistakenly committed into the repository during the external meta cache refactor. The file is only used as an implementation-time guidance document and is not part of the Doris source tree. This change removes it from version control while keeping the local copy intact, so future code changes stay focused on actual product source files. ### Release note None ### Check List (For Author) - Test: No need to test (repository hygiene change only) - Behavior changed: No - Does this need documentation: No
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
Author
|
run buildall |
Contributor
TPC-H: Total hot run time: 29809 ms |
Contributor
TPC-DS: Total hot run time: 173774 ms |
Contributor
ClickBench: Total hot run time: 25.22 s |
Contributor
FE UT Coverage ReportIncrement line coverage |
Contributor
FE UT Coverage ReportIncrement line coverage |
Contributor
TPC-H: Total hot run time: 29829 ms |
Contributor
TPC-DS: Total hot run time: 173258 ms |
Contributor
ClickBench: Total hot run time: 25.27 s |
Contributor
FE Regression Coverage ReportIncrement line coverage |
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.
What problem does this PR solve?
Issue Number: N/A
Related PR: N/A
Problem Summary:
This PR refactors the external metadata cache to use MetaCacheEntry-based publication and invalidation, and follows up with fixes from review and validation. It aligns the negative lookup semantics across init and replay paths, keeps replay lookup non-blocking, preserves the expected lower-case mode 0/1/2 behavior, and adds regression and manual validation coverage for refresh non-blocking and mutable name miss refresh scenarios.
Release note
Improve consistency and validation coverage for external metadata cache refresh and name lookup behavior.
Check List (For Author)
Manual test details:
tools/manual_external_meta_cache_regression/verify_name_miss_refresh_mutable.shtools/manual_external_meta_cache_regression/verify_table_names_refresh_non_blocking.shtools/manual_external_meta_cache_regression/verify_schema_refresh_non_blocking.shUnit test details:
./run-fe-ut.sh --run org.apache.doris.datasource.metacache.MetaCacheEntryTestBehavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)
Attached Documents