-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
[DOCS] Reformat shrink index API docs #46711
Conversation
Pinging @elastic/es-docs |
Pinging @elastic/es-core-features |
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.
A couple minor editorial comments, but other than that LGTM.
|
||
In order to shrink an index, the index must be marked as read-only, and a | ||
(primary or replica) copy of every shard in the index must be relocated to the | ||
same node and have <<cluster-health,health>> `green`. | ||
same node and have a <<cluster-health, cluster health>> status of `green`. |
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.
This reads awkardly--the subject is "a copy of every shard", but the last clause is referring to the node status. I'd probably make this a list:
Before you can shrink an index:
- The index must be read-only.
- A copy of every shard in the index must reside on the same node.
- The <<cluster-health, cluster health>> status must be
green
.
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.
Fixed with e6f9b25.
|
||
In order to shrink an index, the index must be marked as read-only, and a | ||
(primary or replica) copy of every shard in the index must be relocated to the | ||
same node and have <<cluster-health,health>> `green`. | ||
same node and have a <<cluster-health, cluster health>> status of `green`. | ||
|
||
These two conditions can be achieved with the following request: |
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.
There are really three conditions.
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.
Fixed with e6f9b25.
Shrinking works as follows: | ||
|
||
* First, it creates a new target index with the same definition as the source | ||
index, but with a smaller number of primary shards. | ||
|
||
* Then it hard-links segments from the source index into the target index. (If | ||
the file system doesn't support hard-linking, then all segments are copied | ||
into the new index, which is a much more time consuming process. Also if using | ||
multiple data paths, shards on different data paths require a full copy of | ||
segment files if they are not on the same disk since hardlinks don’t work across | ||
disks) | ||
|
||
* Finally, it recovers the target index as though it were a closed index which | ||
had just been re-opened. |
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.
Referring to "Shrinking" as "it" strikes me as odd. Maybe:
A shrink operation:
- Creates the target index...
- Hard links...
- Recovers the target index...
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.
Fixed with e6f9b25.
==== Wait For Active Shards | ||
|
||
[[shrink-wait-active-shards]] | ||
===== Wait For active shards |
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.
Lowercase for?
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.
Fixed with e6f9b25.
Thanks @debadair! |
Reverts an anchor change from #46711. Previous versions of the docs use the `_shrinking_an_index` anchor for this section. Preserving that anchor will prevent doc build breaks in future releases.
Reformats the shrink API docs to align with the new API reference template.
Relates to #43765.