[FLINK-40092] Finalize BlueGreen transition after deleting previous deployment #1154
Merged
gyfora merged 3 commits intoJul 14, 2026
Merged
Conversation
fqshopify
marked this pull request as ready for review
July 7, 2026 19:01
fqshopify
force-pushed
the
finalize-forward-to-ACTIVE_GREEN-when-blue-is-deleted
branch
from
July 10, 2026 16:45
31fbab1 to
3b46e13
Compare
drossos
approved these changes
Jul 10, 2026
drossos
left a comment
Contributor
There was a problem hiding this comment.
Great fix for the BG bug we found.
CC: @gyfora & @schongloo for 👀 and FYI
Dennis-Mircea
left a comment
Contributor
There was a problem hiding this comment.
Nice change, and it's more than the description says: finalizing in the same reconcile that deletes Blue doesn't just save a loop, it closes a real correctness window. In the old flow, after Blue was deleted the transition stayed in TRANSITIONING_TO_GREEN with abortTimestamp set, so a later reconcile that saw a not-ready Green blip past the abort deadline would abortDeployment and roll back to an already-deleted Blue.
Dennis-Mircea
approved these changes
Jul 14, 2026
fqshopify
deleted the
finalize-forward-to-ACTIVE_GREEN-when-blue-is-deleted
branch
July 14, 2026 20:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
This pull request removes an unnecessary extra reconciliation loop during
FlinkBlueGreenDeploymentcutover, and in doing so closes a window that could cause a spurious abort with no rollback target.Previously, after the operator successfully deleted the previous (Blue)
FlinkDeployment, it returnednoUpdate().rescheduleAfter(RETRY_DELAY_MS)without finalizing, leaving the BlueGreen resource inTRANSITIONING_TO_GREEN. Finalization to the terminalACTIVE_GREENstate only happened on a later reconciliation.That extra loop is not just wasteful, it re-runs
monitorTransitionon Green while the transition is still considered in-flight, so if Green is observed not ready in that window it is routed toshouldWeAbortand Green is suspended. With Blue already deleted, there is no rollback target left so the terminal state is no pipelines running i.e. downtime!As a result, once the previous deployment has been successfully deleted, the transition can and should be committed forward immediately. This change reuses the existing
finalizeBlueGreenDeploymentlogic in the same reconciliation that deletes Blue, so the abort path is no longer reachable after cutover.Brief change log
FlinkBlueGreenDeploymentStateintodeleteDeployment.FlinkDeployment.ACTIVE_GREENin the same reconciliation that deletes Blue.Does this pull request potentially affect one of the following parts:
CustomResourceDescriptors: noDocumentation