-
Notifications
You must be signed in to change notification settings - Fork 550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] fix ArrayNode state's TaskPhase reset #5451
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Paul Dittamo <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5451 +/- ##
=======================================
Coverage 61.07% 61.07%
=======================================
Files 793 793
Lines 51226 51226
=======================================
Hits 31288 31288
Misses 17062 17062
Partials 2876 2876
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This reverts commit 9f4306a. Signed-off-by: Paul Dittamo <[email protected]>
Signed-off-by: Paul Dittamo <[email protected]>
|
||
// if the ArrayNode phase has changed we need to reset the taskPhaseVersion to 0 | ||
if currentArrayNodePhase != arrayNodeState.Phase { | ||
arrayNodeState.TaskPhaseVersion = 0 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't setting this afterwards cause problems with admin requiring incremental values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scenario of interest would be if we would lose some eventing data if we have incrementPhase = False and currentArrayNodePhase != arrayNodeState.Phase + have a previous event emitted with the same TaskPhase and TaskPhaseVersion.
We set incrementTaskPhaseVersion = True if there's a subnode phase change. The arrayNodeState.Phase is updated in 3 different places: arrayNodeState.Phase = v1alpha1.ArrayNodePhaseFailing, arrayNodeState.Phase = v1alpha1.ArrayNodePhaseSucceeding, and arrayNodeState.Phase = v1alpha1.ArrayNodePhaseExecuting.
For arrayNodeState.Phase = v1alpha1.ArrayNodePhaseFailing and arrayNodeState.Phase = v1alpha1.ArrayNodePhaseSucceeding, there would have to be subnode phase change so we couldn't have a scenario where incrementPhase = False and currentArrayNodePhase != arrayNodeState.Phase.
For arrayNodeState.Phase = v1alpha1.ArrayNodePhaseExecuting, we shouldn't have a previous event emitted with the same TaskPhase and TaskPhaseVersion as we should only be in the v1alpha1.ArrayNodePhaseNone phase for the first pass through.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proceeding loops would have a new TaskPhase as well.
Tracking issue
Why are the changes needed?
When a NodePhase change is detected, the current implementation resets the TaskPhaseVersion to 0 prior to emitting the event. This would create a duplicate event since the TaskPhase isn't also updated causing for the event to not get emitted/persisted to admin.
What changes were proposed in this pull request?
We opt to do this instead of bumping the task phase as that can cause issues.
Example issue:
Also this seems to be consistent with letting the proceeding propeller loop handling the next state.
How was this patch tested?
Ran through different failing and succeeding scenarios and ensured that the subnodes phases transitioned to the correct terminal phase.
Setup process
Screenshots
Check all the applicable boxes
Related PRs
Docs link