-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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 parameter to index open command #26682
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left two minor documentation comments, otherwise looks good to me.
We can change the default of only waiting for the primary shards | ||
to start through the request parameter `wait_for_active_shards`. | ||
A detailed explanation of `wait_for_active_shards` and its possible values | ||
can be found <<index-wait-for-active-shards,here>>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to link to the "Wait For Active Shards" section of the "Create index" command. The section linked to here is about the same name parameter that is used when indexing documents.
Also I think this section can be shorter and just link to index creation, e.g.:
[float]
=== Wait For Active Shards
Because opening an index allocates its shards, the
<<create-index-wait-for-active-shards,`wait_for_active_shards`>> setting on
index creation applies to the index opening action as well.
}, | ||
"wait_for_active_shards": { | ||
"type" : "string", | ||
"description" : "Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you copied this from the wrong location (this is the description that applies to the indexing command, not the index creation command). That one just states
"wait_for_active_shards": {
"type" : "string",
"description" : "Set the number of active shards to wait for before the operation returns."
},
@ywelsch Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @alexshadow007
@elasticmachine test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running the tests, I noticed the PR still needs to implement a BWC layer for interoperability with ES versions that won't have this commit. Can you add that?
3a8181f
to
d0ffa5b
Compare
@ywelsch Done |
@elasticmachine retest this please |
Thanks @alexshadow007. I will see about backporting this (and adding a note to the Breaking changes documentation as we now wait for the primaries to be allocated before the command returns). |
…mmand This commit disables BWC tests while adding a v6.1 BWC layer for the PR #26682
Adds the wait_for_active_shards parameter to the index open command. Similar to the index creation command, the index open command will now, by default, wait until the primaries have been allocated. Closes #20937
I've backported this to the 6.1 branch, but changed the default of the |
Closes #20937