You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ashangit (via GitHub)" <gi...@apache.org> on 2023/06/20 12:05:56 UTC

[GitHub] [flink-kubernetes-operator] ashangit commented on a diff in pull request #622: [FLINK-32012] Provide rollback feature on savepoint upgrade mode if HA missing and JM never started

ashangit commented on code in PR #622:
URL: https://github.com/apache/flink-kubernetes-operator/pull/622#discussion_r1235168059


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/ReconciliationUtils.java:
##########
@@ -281,6 +284,17 @@ public static boolean isUpgradeModeChangedToLastStateAndHADisabledPreviously(
                 && !HighAvailabilityMode.isHighAvailabilityModeActivated(observeConfig);
     }
 
+    public static <SPEC extends AbstractFlinkSpec> SPEC getLastSpec(
+            AbstractFlinkResource<SPEC, ?> deployment) {
+        var reconciliationStatus = deployment.getStatus().getReconciliationStatus();
+        var reconciliationState = reconciliationStatus.getState();
+        if (reconciliationState != ReconciliationState.ROLLED_BACK) {
+            return reconciliationStatus.deserializeLastReconciledSpec();
+        } else {
+            return reconciliationStatus.deserializeLastRollbackSpec();

Review Comment:
   I rely on the `lastStableSpec` to do the rollback.
   It is indeed the spec used to roll back to a working state.
   But once the job is rolled back I need to be able to detect changes to the current spec (the one which has lead to the rollback). As the job spec has not been updated we need to be able to compare it with a specific stored spec from which we will be able to do comparison and find changes
   I can't rely on the `lastReconcileSpec` or `lastStableSpec` as they are not align with the job spec.
   This is why I introduce this `lastRollbackSpec` which contains the job spec leading to failure.



-- 
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