feat(logstorage): validate replicas < node count to prevent ILM stall#4529
Open
tianfeng92 wants to merge 3 commits intotigera:masterfrom
Open
feat(logstorage): validate replicas < node count to prevent ILM stall#4529tianfeng92 wants to merge 3 commits intotigera:masterfrom
tianfeng92 wants to merge 3 commits intotigera:masterfrom
Conversation
tmjd
approved these changes
Mar 12, 2026
rene-dekker
reviewed
Mar 12, 2026
rene-dekker
requested changes
Mar 12, 2026
765effe to
0e6fd84
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.
0e6fd84 to
cc42c9a
Compare
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.