Fix StatefulSet recreate failure handling - #1997
Conversation
Bug: when restart fallback scaled a host StatefulSet down, a timed-out StatefulSet delete was ignored and the following create failure was converted into ErrCRUDRecreate, which the create path also ignored. The reconcile could therefore report success while the old StatefulSet was still deleting and the replacement pod was not created. Fix: abort recreate when StatefulSet deletion fails, treat create API failures as aborts, and defensively abort if ErrCRUDRecreate reaches the create completion path. Tests: add focused statefulset reconciler unit coverage for create errors, unexpected recreate actions in the create path, and delete failures during recreate.
|
Interesting, same problem fixed here: #1993 and it is "treating the cause". Both PRs do not fix all problems. #1997 it is more defensive (catches a wider family of failures, not just 409 on scale-down) but it is missing doDeleteStatefulSet early-return when scale-to-0 (Update) fails and Delete never happens. Probably best way will be to merge #1993 and then rebase on #1997 |
|
Short answer: the delete-path part of #1997 is on a real, used path. The create-path Abort rewrite is weaker, and much of the PR is already superseded on current What the PR changes
Is it actually used?Delete/recreate path — yes, real.
That is the #1995 bug: scale-down/delete fails, create is still attempted / error ignored, reconcile looks successful while STS/pod are missing. Honoring delete failure is necessary and reachable. Create-path Abort — mixed. After #1997 itself changes
So item (4) is mostly defensive dead code once (3) lands. Item (3) itself is used (Create can fail), but Abort vs Recreate is a policy choice. Already superseded locallyYour current tree already has the useful delete fixes (and more), largely from #1993 plus follow-ups:
And for create failures, current code deliberately keeps Verdict
So: the bugfix idea is real and the recreate/delete path matters, but as a PR against current |
Fix for #1995
Test was written by Codex.
Important items to consider before making a Pull Request
Please check items PR complies to:
next-releasebranch, not intomasterbranch1. More info--
1 If you feel your PR does not affect any Go-code or any testable functionality (for example, PR contains docs only or supplementary materials), PR can be made into
masterbranch, but it has to be confirmed by project's maintainer.