[Fix] Fix savepoint state stuck in SAVEPOINTING after savepoint completion (#4338) - #4504
Open
zhang-arvin wants to merge 1 commit into
Open
[Fix] Fix savepoint state stuck in SAVEPOINTING after savepoint completion (#4338)#4504zhang-arvin wants to merge 1 commit into
zhang-arvin wants to merge 1 commit into
Conversation
…etion Fixes apache#4338: When manually triggering a savepoint, the release status remains in WAITING/SAVEPOINTING state even after the savepoint completes. Root cause: 1. DeflaterUtils.unzipString() throws IllegalArgumentException when flinkConf is not valid Base64 (e.g., stored as plain file path), which propagates up and causes savepoint saving to fail. 2. FlinkCheckpointProcessor.process() does not clean the SAVEPOINT_CACHE when saveSavepoint() throws an exception, causing the state to remain stuck in SAVEPOINTING. Changes: 1. DeflaterUtils.unzipString(): catch IllegalArgumentException from Base64.getDecoder().decode() and return null gracefully. 2. FlinkCheckpointProcessor.process(): wrap saveSavepoint() in try-finally to ensure cleanSavepoint() is always called. 3. FlinkEnv.convertFlinkYamlAsMap() and getFlinkConfig(): handle null return from unzipString() gracefully, returning empty map/properties.
|
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?
Fixes #4338: When manually triggering a savepoint, the release status remains in WAITING/SAVEPOINTING state even after the savepoint completes.
Root Cause Analysis
DeflaterUtils.unzipString()throwsIllegalArgumentExceptionwhenflinkConfis not valid Base64 (e.g., stored as plain file path instead of compressed content). This exception propagates up throughsaveSavepoint()→save()→expire()→getChkNumRetainedFromFlinkEnv()→convertFlinkYamlAsMap()→unzipString().FlinkCheckpointProcessor.process()does not clean theSAVEPOINT_CACHEwhensaveSavepoint()throws an exception. This causes theFlinkAppHttpWatcherto keep setting the option state toSAVEPOINTINGon every poll cycle, since the cache entry is never removed.Changes
DeflaterUtils.unzipString(): CatchIllegalArgumentExceptionfromBase64.getDecoder().decode()and returnnullgracefully, similar to the existingDataFormatExceptionhandling.FlinkCheckpointProcessor.process(): WrapsaveSavepoint()in try-finally to ensurecleanSavepoint()is always called, preventing theSAVEPOINT_CACHEfrom leaking.FlinkEnv.convertFlinkYamlAsMap()andgetFlinkConfig(): Handle null return fromunzipString()gracefully, returning empty map/properties.Verification