Skip to content

[Fix] Fix savepoint state stuck in SAVEPOINTING after savepoint completion (#4338) - #4504

Open
zhang-arvin wants to merge 1 commit into
apache:devfrom
zhang-arvin:fix/issue-4338-savepoint-state
Open

[Fix] Fix savepoint state stuck in SAVEPOINTING after savepoint completion (#4338)#4504
zhang-arvin wants to merge 1 commit into
apache:devfrom
zhang-arvin:fix/issue-4338-savepoint-state

Conversation

@zhang-arvin

Copy link
Copy Markdown

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

  1. DeflaterUtils.unzipString() throws IllegalArgumentException when flinkConf is not valid Base64 (e.g., stored as plain file path instead of compressed content). This exception propagates up through saveSavepoint()save()expire()getChkNumRetainedFromFlinkEnv()convertFlinkYamlAsMap()unzipString().

  2. FlinkCheckpointProcessor.process() does not clean the SAVEPOINT_CACHE when saveSavepoint() throws an exception. This causes the FlinkAppHttpWatcher to keep setting the option state to SAVEPOINTING on every poll cycle, since the cache entry is never removed.

Changes

  1. DeflaterUtils.unzipString(): Catch IllegalArgumentException from Base64.getDecoder().decode() and return null gracefully, similar to the existing DataFormatException handling.

  2. FlinkCheckpointProcessor.process(): Wrap saveSavepoint() in try-finally to ensure cleanSavepoint() is always called, preventing the SAVEPOINT_CACHE from leaking.

  3. FlinkEnv.convertFlinkYamlAsMap() and getFlinkConfig(): Handle null return from unzipString() gracefully, returning empty map/properties.

Verification

…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.
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Manually trigger the savepoint. After the savepoint is completed, the release status remains in WAITING.

1 participant