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


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/deployment/AbstractJobReconciler.java:
##########
@@ -313,9 +313,19 @@ protected void resubmitJob(FlinkResourceContext<CR> ctx, 
boolean requireHaMetada
             throws Exception {
         LOG.info("Resubmitting Flink job...");
         SPEC specToRecover = 
ReconciliationUtils.getDeployedSpec(ctx.getResource());
+        Optional<Savepoint> lastSavepoint =
+                Optional.ofNullable(
+                        ctx.getResource()
+                                .getStatus()
+                                .getJobStatus()
+                                .getSavepointInfo()
+                                .getLastSavepoint());
         if (requireHaMetadata) {
             specToRecover.getJob().setUpgradeMode(UpgradeMode.LAST_STATE);
+        } else if (lastSavepoint.isPresent()) {

Review Comment:
   I wonder if we should change this to 
`ctx.getResource().getSpec().getJob().getUpgradeMode() != STATELESS && 
lastSavepoint.isPresent()`
   
   Wouldn't it be weird that you have stateless upgrade mode (for a reason) and 
maybe a savepoint from a very long time ago and the job still gets submitted 
from it?



-- 
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-unsubscr...@flink.apache.org

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

Reply via email to