Dennis-Mircea commented on code in PR #1159:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/1159#discussion_r3561402528


##########
flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/controller/FlinkBlueGreenDeploymentControllerTest.java:
##########
@@ -558,6 +558,198 @@ public void verifyFailureDuringTransition(FlinkVersion 
flinkVersion) throws Exce
         testTransitionToGreen(rs, customValue, null);
     }
 
+    /** Regression test: an aborted transition must reset the delete-Blue 
deletion delay. */
+    @ParameterizedTest
+    
@MethodSource("org.apache.flink.kubernetes.operator.TestUtils#flinkVersions")
+    public void verifyReadyTimestampResetOnAbortPreventsPrematureBlueDelete(
+            FlinkVersion flinkVersion) throws Exception {
+        var blueGreenDeployment =
+                buildSessionCluster(
+                        TEST_DEPLOYMENT_NAME,
+                        TEST_NAMESPACE,
+                        flinkVersion,
+                        null,
+                        UpgradeMode.SAVEPOINT);
+
+        // Abort grace long enough to let Green be marked ready before any 
abort fires;
+        // a non-trivial deletion delay so the delete-Blue wait is observable.
+        var abortGracePeriodMs = 1500;
+        var deletionDelayMs = 1000;

Review Comment:
   Consider using `await()` instead of these long sleep intervals.



##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/controller/bluegreen/BlueGreenDeploymentService.java:
##########
@@ -686,6 +686,8 @@ private UpdateControl<FlinkBlueGreenDeployment> 
abortDeployment(
                 getPreviousState(nextState, context.getDeployments());
         context.getDeploymentStatus().setBlueGreenState(previousState);
         context.getDeploymentStatus().setSavepointTriggerId(null);
+        
context.getDeploymentStatus().setDeploymentReadyTimestamp(millisToInstantStr(0));
+        context.getDeploymentStatus().setAbortTimestamp(millisToInstantStr(0));

Review Comment:
   These three resets (+ `savepointTriggerId` above) are now duplicated in 
`finalizeBlueGreenDeployment`, `finalizeSuspendedDeployment`, and here. Could 
we extract a `resetTransitionMarkers(status)` helper and call it from all 
three, so they can't diverge again?



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

Reply via email to