Skip to content

fix(controller): order a snapshot abort's resume even when a status stamp fails - #324

Merged
Andrei Kvapil (kvaps) merged 3 commits into
mainfrom
fix/snapshot-abort-resume-on-stamp-failure
Nov 24, 2026
Merged

Andrei Kvapil (kvaps) merged 3 commits into
mainfrom
fix/snapshot-abort-resume-on-stamp-failure

Conversation

@kvaps

Copy link
Copy Markdown
Member

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 suspendIO stayed 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 reached main.

Changes

  • A failed IOSuspended stamp no longer stops the pass. The abort still runs and orders the resume, which is a spec write, and the stamp error is returned afterwards so the pass is retried and the condition catches up.
  • When the pass also fails on its own (sibling list, abort, adopted backfill), that error is returned and the stamp failure is only logged next to it. Joining the two would let a stamp that lost a race (a 409) make a real failure look like a conflict, and fix(controller,satellite): stop logging self-healing write conflicts at ERROR #316 retries conflicts quietly at V(1), so the real failure would disappear from the error log.
  • The adopted-snapshot backfill returns only an error, since its result was always empty.

Interactions with other open PRs

Testing

  • New unit test: an abort past its deadline clears suspendIO while every status write is refused, and the refused write is still reported. It fails without the fix.
  • New unit test: a sibling list failure combined with a 409 from the stamp is returned as the list failure and does not satisfy apierrors.IsConflict. It fails with the errors joined (mutation-checked).
  • go test ./internal/controller with envtest assets: pass.
  • go test -tags=integration ./tests/integration/ -run '^(TestGroupG|TestGroupFRDeleteCascadesSnapshots|TestSmoke)': pass.

Not tested

  • Lint was not run locally; CI runs it once the PR is open.
  • No run against a live cluster.

…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>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d1bacc7e-d28b-4d01-920a-8a5fbc861244
Commits

Reviewing files that changed from the base of the PR and between ee04562 and 45ed876.

Files selected for processing: 2

  • internal/controller/snapshot_controller.go
  • internal/controller/snapshot_io_suspended_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kvaps
Andrei Kvapil (kvaps) merged commit a1002ba into main Nov 24, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants