[fix](fe) Skip DEC journal when dictionary dropped during load commit - #66552
Open
zclllyybb wants to merge 1 commit into
Open
[fix](fe) Skip DEC journal when dictionary dropped during load commit#66552zclllyybb wants to merge 1 commit into
zclllyybb wants to merge 1 commit into
Conversation
### What problem does this PR solve? Problem Summary: An async dictionary load task writes the INC version journal, then DROP deletes the dictionary, then a failed BE commit writes a DEC journal for the already dropped dictionary. Followers exit while replaying the DEC journal because the dictionary cannot be found by name anymore, and the cluster cannot recover since the bad journal is persistent. Root cause: the commit failure rollback runs outside the manager lock and does not check whether the dictionary is still current, so DROP can interleave between the INC journal and the rollback DEC journal. Replay of the DEC journal looks the dictionary up by name and throws when it is gone, which makes EditLog.loadJournal exit the FE. Fix: on commit failure, only persist the DEC journal while the dictionary is still the current one (identity check under the manager read lock), so the journal stream becomes CREATE -> INC -> DROP instead of CREATE -> INC -> DROP -> DEC. Replay of increase/decrease version journals is made idempotent and keyed by dictionary id, so a DEC journal of an already dropped or recreated dictionary is a no-op instead of a fatal error. ### Release note None ### Check List (For Author) - Test: Unit test DictionaryManagerTest (replay idempotency, journal order CREATE -> INC -> DROP -> DEC, ABA recreated same-name dictionary) and docker regression test test_dictionary_drop_while_load_commit_fail (deterministic race reproduction via debug points). - 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
FE UT Coverage ReportIncrement line coverage |
Contributor
TPC-H: Total hot run time: 28788 ms |
Contributor
TPC-DS: Total hot run time: 165648 ms |
Contributor
ClickBench: Total hot run time: 24.04 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?
An async dictionary load task writes the INC version journal, then DROP deletes the dictionary, then a failed BE commit writes a DEC journal for the already dropped dictionary. Followers exit while replaying the DEC journal because the dictionary cannot be found by name anymore, and the cluster cannot recover since the bad journal is persistent.
Root cause: the commit failure rollback runs outside the manager lock and does not check whether the dictionary is still current, so DROP can interleave between the INC journal and the rollback DEC journal. Replay of the DEC journal looks the dictionary up by name and throws when it is gone, which makes EditLog.loadJournal exit the FE.
Fix: on commit failure, only persist the DEC journal while the dictionary is still the current one (identity check under the manager read lock), so the journal stream becomes CREATE -> INC -> DROP instead of CREATE -> INC -> DROP -> DEC. Replay of increase/decrease version journals is made idempotent and keyed by dictionary id, so a DEC journal of an already dropped or recreated dictionary is a no-op instead of a fatal error.
Release note
None
Check List (For Author)