Repository navigation
fix(controller): order a snapshot abort's resume even when a status stamp fails - #324
Conversation
…tamp fails The IOSuspended condition stamp runs before anything else in the snapshot reconcile and returned on error, so a status subresource that refused writes kept a take past its deadline frozen: the abort, which clears suspendIO and records abortReason in the spec, never ran. The abort's resume is the outage fix and must not wait on a status write; the condition error is still returned once that write is done, so the pass is retried and the condition catches up. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
The resume-on-abort change joined a failed IOSuspended stamp into the pass's own error. A stamp that lost to a concurrent write is a 409, and apierrors.IsConflict walks a joined error, so a sibling list or abort failure joined with that 409 reads as a benign conflict once conflicts requeue quietly. Return the pass's own error and log the stamp failure beside it; with no pass error the stamp error is still returned so the pass is retried. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
The adopted backfill always returned an empty Result, which unparam flags now that the caller reads it instead of passing it through, and the new conflict test built its cause with a dynamic error. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 43 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Aleksei Sviridkin (lexfrei)
left a comment
There was a problem hiding this comment.
LGTM. The stamp works on its own fresh Get under RetryOnConflict and never mutates snap, so letting the abort run after a failed stamp sees the same object it did before. Nothing outside tests reads the IOSuspended condition, so a lagging stamp only delays what kubectl shows, and the returned stamp error makes the pass retry until it catches up. Phase advancement still waits on the stamp; only the abort skips ahead, which is the point. withStampError keeping the pass error ahead of a 409 is right, since apierrors.IsConflict unwraps joined errors.
What this fixes
The snapshot controller stamps the IOSuspended condition before anything else in a pass and returned as soon as that stamp failed. When the status subresource refused the write, a take that was already past its suspend deadline never reached the abort, so
suspendIOstayed set and I/O on every diskful replica stayed frozen. This is the same outage #282 set out to end. The fix for it was committed to the #282 branch 31 seconds before that PR was merged and was not part of the merged head, so it never reachedmain.Changes
Interactions with other open PRs
mainwithout them. Whichever of the two merges second sees the change already applied.apierrors.IsConflicton the returned error, which is why the stamp error is no longer joined into the pass error.Testing
suspendIOwhile every status write is refused, and the refused write is still reported. It fails without the fix.apierrors.IsConflict. It fails with the errors joined (mutation-checked).go test ./internal/controllerwith envtest assets: pass.go test -tags=integration ./tests/integration/ -run '^(TestGroupG|TestGroupFRDeleteCascadesSnapshots|TestSmoke)': pass.Not tested