|
70 | 70 | // - [NO LABEL]: No nvsentinel-state label present (healthy node) |
71 | 71 | // - [TERMINAL]: Terminal states with no forward transitions |
72 | 72 | // - remediation-succeeded and remediation-failed are terminal for a single failure, but |
73 | | -// fault-remediation may recompute between them on a partial recovery (see below) |
| 73 | +// fault-remediation may recompute between them on a partial recovery, and either may |
| 74 | +// return to remediating when a new remediation cycle starts (see below) |
74 | 75 | // - All state names match the dgxc.nvidia.com/nvsentinel-state label values |
75 | 76 | // - Label removal (removeStateLabel=true) bypasses all validation |
76 | 77 | // |
|
98 | 99 | // remediation-succeeded → remediation-failed (fault-remediation: a remaining active failure is |
99 | 100 | // unsupported or failed remediation) |
100 | 101 | // |
| 102 | +// Re-remediation (a new remediation cycle starts while the node stays quarantined): |
| 103 | +// remediation-succeeded → remediating (fault-remediation: a new remediation-ready event |
| 104 | +// arrived after the previous maintenance CR completed, |
| 105 | +// e.g. a post-reboot fault) |
| 106 | +// remediation-failed → remediating (fault-remediation: a failed CR is retried with a new CR) |
| 107 | +// |
101 | 108 | // Label Removal (from ANY state): |
102 | 109 | // * → (no label) (removeStateLabel=true - supports canceled drains) |
103 | 110 | // |
|
115 | 122 | // Invalid Transitions: |
116 | 123 | // drain-succeeded → drain-failed (cannot reverse drain result) |
117 | 124 | // drain-failed → remediating (terminal state - no remediation) |
118 | | -// remediation-succeeded → * (except remediation-failed via partial-recovery recompute) |
119 | | -// remediation-failed → * (except remediation-succeeded via partial-recovery recompute) |
| 125 | +// remediation-succeeded → * (except remediation-failed via partial-recovery recompute |
| 126 | +// and remediating via re-remediation) |
| 127 | +// remediation-failed → * (except remediation-succeeded via partial-recovery recompute |
| 128 | +// and remediating via re-remediation) |
120 | 129 | // |
121 | 130 | // # Example Sequences |
122 | 131 | // |
|
150 | 159 | // drain-failed has no valid forward transitions (only label removal): |
151 | 160 | // - drain-failed: Remediation doesn't process failed drains |
152 | 161 | // |
153 | | -// remediation-succeeded and remediation-failed are terminal for a single failure. The only |
154 | | -// forward transition allowed is between the two of them, when fault-remediation recomputes the |
155 | | -// node label from the remaining active failures during a partial recovery: |
156 | | -// - remediation-succeeded: Success state (may be recomputed to remediation-failed) |
157 | | -// - remediation-failed: Failure state (may be recomputed to remediation-succeeded) |
| 162 | +// remediation-succeeded and remediation-failed are terminal for a single failure. Two forward |
| 163 | +// transitions are allowed: between the two of them, when fault-remediation recomputes the node |
| 164 | +// label from the remaining active failures during a partial recovery, and back to remediating, |
| 165 | +// when fault-remediation starts a new remediation cycle (a remediation-ready event arrived after |
| 166 | +// the previous maintenance CR completed, or a failed CR is retried with a new CR): |
| 167 | +// - remediation-succeeded: Success state (may be recomputed or re-enter remediating) |
| 168 | +// - remediation-failed: Failure state (may be recomputed or re-enter remediating) |
158 | 169 | package statemanager |
159 | 170 |
|
160 | 171 | import ( |
@@ -403,9 +414,13 @@ func validateStateTransition(nodeName, currentValue string, exists bool, targetS |
403 | 414 | // remediation-succeeded and remediation-failed are terminal for a single failure, but a |
404 | 415 | // partial recovery (a tracked failure clears while the node stays quarantined) lets |
405 | 416 | // fault-remediation recompute the node label from the remaining active failures, which can |
406 | | - // move between the two terminal remediation outcomes. |
407 | | - RemediationSucceededLabelValue: {RemediationFailedLabelValue}, |
408 | | - RemediationFailedLabelValue: {RemediationSucceededLabelValue}, |
| 417 | + // move between the two terminal remediation outcomes. Both states can also return to |
| 418 | + // remediating: a new remediation-ready event can arrive after an equivalent maintenance CR |
| 419 | + // completed (for example a post-reboot fault while the node is still quarantined), and a |
| 420 | + // failed CR is retried with a new CR, so fault-remediation legitimately starts another |
| 421 | + // remediation cycle within the same quarantine session. |
| 422 | + RemediationSucceededLabelValue: {RemediationFailedLabelValue, RemediatingLabelValue}, |
| 423 | + RemediationFailedLabelValue: {RemediationSucceededLabelValue, RemediatingLabelValue}, |
409 | 424 | } |
410 | 425 |
|
411 | 426 | currentState := NVSentinelStateLabelValue(currentValue) |
|
0 commit comments