You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/05/22 23:07:54 UTC

[GitHub] [flink-kubernetes-operator] gyfora commented on a diff in pull request #236: [hotfix] Fix last checkpoint observe with empty history

gyfora commented on code in PR #236:
URL: https://github.com/apache/flink-kubernetes-operator/pull/236#discussion_r878938574


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/FlinkService.java:
##########
@@ -633,8 +623,26 @@ public Optional<Savepoint> getLastCheckpoint(JobID jobId, Configuration conf) th
                                                                             .FIELD_NAME_EXTERNAL_PATH)
                                                             .asText()));
 
+            if (latestCheckpointOpt.isEmpty()) {
+                // Use restore checkpoint instead
+                LOG.info(
+                        "Could not find any checkpoints in the history, returning restore checkpoint if present");
+                latestCheckpointOpt = checkpoints.getRestorePath().map(Savepoint::of);
+            }
+
             if (!latestCheckpointOpt.isPresent()) {
-                LOG.warn("Could not find any externally addressable checkpoints.");
+                LOG.warn("Could not find any checkpoints.");
+            }
+
+            if (latestCheckpointOpt.isPresent()
+                    && latestCheckpointOpt
+                            .get()
+                            .equals(

Review Comment:
   Good catch I was planning to add a test for this anyways :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org