Skip to content

Fix handling of auto expand replicas for stateless indices#122365

Merged
javanna merged 4 commits intoelastic:mainfrom
javanna:fix/auto_expand_replicas_stateles
Feb 12, 2025
Merged

Fix handling of auto expand replicas for stateless indices#122365
javanna merged 4 commits intoelastic:mainfrom
javanna:fix/auto_expand_replicas_stateles

Conversation

@javanna
Copy link
Contributor

@javanna javanna commented Feb 12, 2025

Auto expand replicas is meant to be entirely disabled for stateless indices. The only scenario where a change needs to be applied is when the number of replicas is initialized to 0, in which case 0 needs to be turned into 1. Otherwise, no changes should be applied in stateless indices despite auto expand replicas is used.

The current handling for this was missing an early exit of the indices loop in the case where 0 shoudl be turned into 1, that leads to a potentially higher number of copies being allocated (effectively auto-expand gets applied by mistake).

Auto expand replicas is meant to be entirely disabled for stateless indices.
The only scenario where a change needs to be applied is when the number of replicas
is initialized to 0, in which case 0 needs to be turned into 1. Otherwise, no changes
should be applied in stateless indices despite auto expand replicas is used.

The current handling for this was missing an early exit of the indices loop in the case
where 0 shoudl be turned into 1, that leads to a potentially higher number of copies
being allocated (effectively auto-expand gets applied by mistake).
@javanna javanna added >bug :Distributed/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. :Search Foundations/Search Catch all for Search Foundations v9.1.0 labels Feb 12, 2025
@elasticsearchmachine elasticsearchmachine added Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch Team:Distributed Indexing (obsolete) Meta label for Distributed Indexing team. Obsolete. Please do not use. labels Feb 12, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

@elasticsearchmachine
Copy link
Collaborator

Hi @javanna, I've created a changelog YAML for you.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing)

@javanna javanna removed the :Distributed/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. label Feb 12, 2025
@elasticsearchmachine elasticsearchmachine removed the Team:Distributed Indexing (obsolete) Meta label for Distributed Indexing team. Obsolete. Please do not use. label Feb 12, 2025
Copy link
Member

@piergm piergm left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for working on this Luca! 👍

@javanna javanna added the :Distributed/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. label Feb 12, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Indexing (obsolete) Meta label for Distributed Indexing team. Obsolete. Please do not use. label Feb 12, 2025
@javanna javanna merged commit 8f28bc2 into elastic:main Feb 12, 2025
16 of 17 checks passed
@javanna javanna deleted the fix/auto_expand_replicas_stateles branch February 12, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Distributed/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. :Search Foundations/Search Catch all for Search Foundations Team:Distributed Indexing (obsolete) Meta label for Distributed Indexing team. Obsolete. Please do not use. Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v9.1.0

3 participants