Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ?wait_for_active_shards=default #66575

Conversation

DaveCTurner
Copy link
Contributor

Today you cannot explicitly indicate that an operation should use the
usual behaviour of waiting for active shards according to the underlying
index setting. This is a problem for the close index API which has a
default of none in 7.x for BWC reasons (see #33888), but the usual
behaviour in 8.0: you cannot today opt-in to the 8.0 behaviour with this
parameter.

This commit adds support for the literal value default for the
wait_for_active_shards query parameter.

Relates #66419

Today you cannot explicitly indicate that an operation should use the
usual behaviour of waiting for active shards according to the underlying
index setting. This is a problem for the close index API which has a
default of `none` in 7.x for BWC reasons (see elastic#33888), but the usual
behaviour in 8.0: you cannot today opt-in to the 8.0 behaviour with this
parameter.

This commit adds support for the literal value `default` for the
`wait_for_active_shards` query parameter.

Relates elastic#66419
@DaveCTurner DaveCTurner added >enhancement :Data Management/Indices APIs APIs to create and manage indices and templates v8.0.0 v7.12.0 labels Dec 18, 2020
@DaveCTurner DaveCTurner requested a review from tlrx December 18, 2020 09:30
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Dec 18, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (Team:Core/Features)

@DaveCTurner
Copy link
Contributor Author

I'm not convinced that default is the right word here, although that's what we use internally. The default for some APIs is different. Moreover POST index/_close?wait_for_active_shards=default is different from POST index/_close, which is kind of the point, but from the users' point of view that's a weird thing.

Copy link
Member

@tlrx tlrx left a comment

Choose a reason for hiding this comment

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

LGTM. There are a bunch of places in Request objects that have the following javadoc:

Defaults to {@link ActiveShardCount#DEFAULT}, which will wait for one shard copy (the primary) to become active

Do you think you could update these docs like you did in the REST API specs?

@DaveCTurner
Copy link
Contributor Author

I'm going to go a different route here and only make this change for the close index API. There are other places where default isn't the default which don't want to be changed like this.

@DaveCTurner DaveCTurner closed this Jan 4, 2021
@DaveCTurner DaveCTurner deleted the 2020-12-18-wait-for-active-shards-explicit-default branch July 23, 2022 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates >enhancement Team:Data Management Meta label for data/management team v7.12.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants