gyfora commented on code in PR #724:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/724#discussion_r1418990597
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/deployment/AbstractJobReconciler.java:
##########
@@ -306,6 +319,40 @@ protected void resubmitJob(FlinkResourceContext<CR> ctx,
boolean requireHaMetada
restoreJob(ctx, specToRecover, ctx.getObserveConfig(),
requireHaMetadata);
}
+ private void redeployWithSavepoint(
+ FlinkResourceContext<CR> ctx,
+ Configuration deployConfig,
+ CR resource,
+ STATUS status,
+ SPEC currentDeploySpec,
+ JobState desiredJobState)
+ throws Exception {
+ LOG.info("Redeploying from savepoint");
+ cancelJob(ctx, UpgradeMode.STATELESS);
+ var savepointOpt =
+
Optional.ofNullable(currentDeploySpec.getJob().getInitialSavepointPath());
+ currentDeploySpec
+ .getJob()
+ .setUpgradeMode(
+ savepointOpt.isPresent() ? UpgradeMode.SAVEPOINT :
UpgradeMode.STATELESS);
Review Comment:
if the `initialSavepointPath` is not present the job will be restarted from
empty state. At least that's how I implemented and documented it. We could
discuss whether this should be allowed or not. The stateless upgradeMode serves
this purpose to some extent but then the user has to change the upgradeMode
back and forth
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]