[fix](cache) Follower FE sql cache not invalidated on table metadata replay (#63612)#63657
Open
924060929 wants to merge 1 commit into
Open
[fix](cache) Follower FE sql cache not invalidated on table metadata replay (#63612)#63657924060929 wants to merge 1 commit into
924060929 wants to merge 1 commit into
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
…replay (apache#63612) Cherry-pick of apache#63612 to branch-4.0. Two-layer fix: 1. Check OlapTable.baseSchemaVersion on cache lookup (lazy, no crash window) 2. OP_TABLE_META_CHANGE journal broadcast (eager, all table types) Add enable_write_op_table_meta_change FE config (default false) to gate the OP_TABLE_META_CHANGE edit log writing. When false, master still does local cache invalidation but does not broadcast to followers via journal. The schemaVersion check still works regardless of this config.
4436288 to
0591da6
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.
Proposed changes
Cherry-pick of #63612.
Follower FEs replay metadata changes (e.g.
ALTER TABLE ... RENAME COLUMN) butnever invalidated the sql cache, so stale entries survived and queries returned
wrong results. Since
enable_sql_cachedefaults totruesince 4.0, everymulti-FE deployment is affected.
Two-layer fix
Layer 1 stores
OlapTable.getBaseSchemaVersion()in cache entries and checkson lookup — lazy validation, zero crash window, automatically covers all DDLs
that bump schemaVersion.
Layer 2 broadcasts
OP_TABLE_META_CHANGEvia journal on DDL, gated byenable_write_op_table_meta_changeFE config (default false):false: master does local cache invalidation only, no journal writetrue: broadcasts to all followersLayer 1 works regardless of the config setting.