[fix](partition) fix table version not updated after replacing temp partition#60888
Open
sollhui wants to merge 2 commits intoapache:masterfrom
Open
[fix](partition) fix table version not updated after replacing temp partition#60888sollhui wants to merge 2 commits intoapache:masterfrom
sollhui wants to merge 2 commits intoapache:masterfrom
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 28482 ms |
TPC-DS: Total hot run time: 182915 ms |
d9d2b58 to
8419725
Compare
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 28657 ms |
TPC-DS: Total hot run time: 183261 ms |
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 28765 ms |
TPC-DS: Total hot run time: 183639 ms |
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
After executing
ALTER TABLE ... REPLACE PARTITION ... WITH TEMPORARY PARTITION,queries on the replaced partition may return empty results due to stale sorted
partition cache.
Root Cause
In
Env.replaceTempPartition(), the table version update is conditionally skippedin non-cloud mode with the comment claiming "the internal partition deletion logic
will update the table version in cloud mode". However, tracing the call chain:
OlapTable.replaceTempPartitions()→dropPartition()→dropPartitionCommon()→
CatalogRecycleBin.recyclePartition()None of these methods update the table version. This means after replacing a temp
partition, the table version remains unchanged, and the sorted partition cache is
not invalidated.
The same issue exists in
replayReplaceTempPartition()on follower FEs.Fix
Remove the
Config.isNotCloudMode()guard so that table version is always updatedafter replacing temp partitions, in both
replaceTempPartition()andreplayReplaceTempPartition().How to Reproduce