feat(logstorage): validate replicas < node count to prevent ILM stall#4529
Merged
rene-dekker merged 4 commits intotigera:masterfrom Mar 16, 2026
Conversation
tmjd
approved these changes
Mar 12, 2026
rene-dekker
reviewed
Mar 12, 2026
rene-dekker
requested changes
Mar 12, 2026
0e6fd84 to
cc42c9a
Compare
On single-node ES clusters with replicas: 1, replica shards can never be allocated. This causes the ILM warm phase migrate action to wait indefinitely for shard copies to become active, blocking progression to the delete phase and causing indices to accumulate beyond retention. Add validation in the LogStorage initializer that rejects configurations where indices.replicas >= nodes.count, with a clear error message guiding users to set replicas to 0 for single-node deployments.
cc42c9a to
b0ce9ae
Compare
Fixes ST1008 staticcheck violation by swapping return order from (error, string) to (string, error) in validateLogStorage and validateReplicasForNodeCount. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
rene-dekker
approved these changes
Mar 16, 2026
tianfeng92
added a commit
to tianfeng92/operator
that referenced
this pull request
Mar 19, 2026
Remove the warning log when LogStorage node count only exceeds replicas by 1. The error validation (replicas >= nodeCount) is preserved. This reverts the warning portion of PR tigera#4529. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 tasks
tianfeng92
added a commit
to tianfeng92/operator
that referenced
this pull request
Mar 19, 2026
Remove the warning log when LogStorage node count only exceeds replicas by 1. The error validation (replicas >= nodeCount) is preserved. This reverts the warning portion of PR tigera#4529. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rene-dekker
pushed a commit
that referenced
this pull request
Mar 19, 2026
Remove the warning log when LogStorage node count only exceeds replicas by 1. The error validation (replicas >= nodeCount) is preserved. This reverts the warning portion of PR #4529. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
tianfeng92
added a commit
to tianfeng92/operator
that referenced
this pull request
Mar 19, 2026
Remove the warning log when LogStorage node count only exceeds replicas by 1. The error validation (replicas >= nodeCount) is preserved. This reverts the warning portion of PR tigera#4529. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tianfeng92
added a commit
to tianfeng92/operator
that referenced
this pull request
Mar 19, 2026
Remove the warning log when LogStorage node count only exceeds replicas by 1. The error validation (replicas >= nodeCount) is preserved. This reverts the warning portion of PR tigera#4529. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rene-dekker
pushed a commit
that referenced
this pull request
Mar 19, 2026
Remove the warning log when LogStorage node count only exceeds replicas by 1. The error validation (replicas >= nodeCount) is preserved. This reverts the warning portion of PR #4529. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
rene-dekker
pushed a commit
that referenced
this pull request
Mar 19, 2026
…4579) * revert: remove logstorage validation warning message Remove the warning log when LogStorage node count only exceeds replicas by 1. The error validation (replicas >= nodeCount) is preserved. This reverts the warning portion of PR #4529. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * empty --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Description
On single-node ES clusters with replicas: 1, replica shards can never be allocated. This causes the ILM warm phase migrate action to wait indefinitely for shard copies to become active, blocking progression to the delete phase and causing indices to accumulate beyond retention.
This PR adds two levels of validation in the LogStorage initializer:
nodeCount <= replicas): Rejects configurations where replica shards cannot be allocated at all, with a clear error message guiding users to set replicas to 0 for single-node deployments.nodeCount == replicas + 1): Logs a warning when the node count only exceeds replicas by 1, since the Elasticsearch PodDisruptionBudget will prevent voluntary pod evictions (e.g., node repaving). This is not treated as an error because it is a valid and common configuration (e.g., Calico Cloud 2-node clusters with 1 replica).For CE master
Jira ticket: CI-1940
Release Note
For PR author
make gen-filesmake gen-versionsFor PR reviewers
A note for code reviewers - all pull requests must have the following:
kind/bugif this is a bugfix.kind/enhancementif this is a a new feature.enterpriseif this PR applies to Calico Enterprise only.