Fix: Prevent CrashLoopBackOff during image upgrade with RollingUpdate (#1926)#1956
Merged
alex-zaitsev merged 1 commit intoAltinity:0.27.0from Apr 15, 2026
Merged
Conversation
Move image change detection before IsRollingUpdate check to prevent forced restart (SYSTEM SHUTDOWN) when upgrading ClickHouse version while simultaneously adding version-specific settings. Fixes Altinity#1926 Signed-off-by: dashashutosh80 <[email protected]>
alex-zaitsev
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Prevent CrashLoopBackOff during image upgrade with RollingUpdate
Description
This PR fixes issue #1926 where upgrading ClickHouse version while simultaneously adding version-specific settings causes pods to enter CrashLoopBackOff when using
spec.restart: RollingUpdate.Problem
When upgrading ClickHouse and adding version-specific configuration simultaneously:
spec.restart: RollingUpdateand attempts forced restart viaSYSTEM SHUTDOWNExample: Upgrading from 25.3 to 25.8 while adding
write_marks_for_substreams_in_compact_parts(only valid in 25.8+) causes 25.3 pods to crash.Root Cause
In
pkg/controller/chi/worker.go, theshouldForceRestartHost()function checksIsRollingUpdate()before checking for image changes:The v0.26.2 fix (commit
e2e8e16de) added image change detection, but it's inside theIsConfigurationChangeRequiresReboot()case, which is never reached whenIsRollingUpdate()returns true first.Solution
Move image change detection before the
IsRollingUpdate()check:The image change check is now a top-level case (not nested inside
IsConfigurationChangeRequiresReboot). This provides universal protection because:SYSTEM SHUTDOWNNow when an image upgrade is happening:
Testing
Tested with:
spec.restart: RollingUpdatewrite_marks_for_substreams_in_compact_parts: 0Result: ✅ Successful upgrade with no CrashLoopBackOff
Operator log evidence:
Complete testing documentation available in the issue comment.
Impact
spec.restart: RollingUpdatewith simultaneous image upgrades and version-specific settingsBehavior Changes
Key insight: Making image change check universal provides broader protection without breaking existing functionality.
Release Notes
Bug Fix: Prevent CrashLoopBackOff when upgrading ClickHouse version with
spec.restart: RollingUpdateand version-specific settings. The operator now correctly defers restart to StatefulSet rolling update when image changes are detected.Checklist
next-releasebranch, not intomasterbranch1. More infoSuggested Target Branch
This is a bug fix suitable for a patch release (0.26.3) as it:
If 0.26.3 branch doesn't exist yet, this can be:
Please advise on the preferred target branch.
Additional Notes
During testing, we also discovered a separate issue where the
onUpdateFailure: abortreconcile policy (introduced to protect Keeper clusters) conflicts with mutating admission webhooks. This is documented separately and not part of this fix. See the issue comment for details.Fixes #1926