Repository navigation
[flink] Refresh writer coordinator metadata after recovery - #11152
Open
huyuanfeng2018 wants to merge 1 commit into
Open
huyuanfeng2018 wants to merge 1 commit into
huyuanfeng2018 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
Fixes #11138.
The writer coordinator refreshes its cached metadata when a checkpoint is triggered, before the committer publishes that checkpoint's table snapshot. The cache survives task recovery, so a restored primary-key writer can initialize its sequence numbers from older files and silently lose replayed updates to already committed rows.
Invalidate the metadata view on both global and subtask recovery, then refresh the snapshot and cached commit identifiers on the existing request executor before serving the next request. Track recovery generations so a failed refresh is retried and a reset during an in-flight refresh is not lost. Keep existing paged responses available to unaffected subtasks.
Tests
57233dbc18db4cefa45ab1447a44843368b1191e: both recovery metadata regressions fail, and the Flink 1.20.1 MiniCluster test returns version 4 instead of 5 with the coordinator enabled. The coordinator-disabled control passes.Validation on Temurin JDK 8u512 and Flink 1.20.1:
WriteOperatorCoordinatorTest: 7 passed.TableWriteCoordinatorTest: 7 passed.WriterCoordinatorRecoveryITCase: 2 passed (coordinator enabled/disabled).git diff --checkpassed.mvn -pl paimon-flink/paimon-flink-common -Pflink1 \ -DwildcardSuites=none -Dflink.forkCount=1 \ -Dtest=WriteOperatorCoordinatorTest,TableWriteCoordinatorTest,WriterCoordinatorRecoveryITCase test