Aitozi commented on a change in pull request #38:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/38#discussion_r821324931
##########
File path:
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/observer/Observer.java
##########
@@ -129,13 +135,53 @@ private boolean observeFlinkJobStatus(FlinkDeployment
flinkApp, Configuration ef
}
}
+ public boolean observeSavepointStatus(FlinkDeployment flinkApp,
Configuration effectiveConfig) {
+ SavepointInfo savepointInfo =
flinkApp.getStatus().getJobStatus().getSavepointInfo();
+ if (savepointInfo.getTriggerId() == null) {
+ LOG.debug("Checkpointing not in progress");
+ return true;
+ }
+ SavepointFetchResult savepointFetchResult;
+ try {
+ savepointFetchResult = flinkService.fetchSavepointInfo(flinkApp,
effectiveConfig);
+ } catch (Exception e) {
+ LOG.error("Exception while fetching savepoint info", e);
+ return false;
+ }
+
+ if (!savepointFetchResult.isTriggered()) {
+ String error = savepointFetchResult.getError();
+ if (error != null
+ ||
!SavepointUtils.withinGracePeriod(operatorConfiguration, savepointInfo)) {
+ LOG.error("Savepoint not triggered, setting reconciliation
error");
Review comment:
Also log the error if not null
##########
File path:
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/observer/Observer.java
##########
@@ -129,13 +135,53 @@ private boolean observeFlinkJobStatus(FlinkDeployment
flinkApp, Configuration ef
}
}
+ public boolean observeSavepointStatus(FlinkDeployment flinkApp,
Configuration effectiveConfig) {
Review comment:
this can be `private`
##########
File path:
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/JobReconciler.java
##########
@@ -101,12 +104,20 @@ public JobReconciler(
restoreFromLastSavepoint(flinkApp, effectiveConfig);
} else if (upgradeMode == UpgradeMode.LAST_STATE) {
final String savepointLocation =
-
flinkApp.getStatus().getJobStatus().getSavepointLocation();
+ flinkApp.getStatus()
+ .getJobStatus()
+ .getSavepointInfo()
+ .getLastSavepoint()
+ .getLocation();
// Upgrade mode changes from savepoint -> last-state
deployFlinkJob(
flinkApp, effectiveConfig,
Optional.ofNullable(savepointLocation));
}
}
+ ReconciliationUtils.updateForSpecReconciliationSuccess(flinkApp);
+ } else if (SavepointUtils.shouldTriggerSavepoint(flinkApp)) {
Review comment:
IMO, This should be one of the sub-condition of `specChanged`. Please
correct me if I'm wrong.
--
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]