-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dangling indices documentation (#58751)
Part of #48366. Add documentation for the dangling indices API added in #58176. Co-authored-by: David Turner <david.turner@elastic.co> Co-authored-by: Adam Locke <adam.locke@elastic.co>
- Loading branch information
1 parent
91db0db
commit 3f51fed
Showing
7 changed files
with
203 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
[[dangling-index-delete]] | ||
=== Delete dangling index API | ||
++++ | ||
<titleabbrev>Delete dangling index</titleabbrev> | ||
++++ | ||
|
||
Deletes a dangling index. | ||
|
||
[[dangling-index-delete-api-request]] | ||
==== {api-request-title} | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
DELETE /_dangling/<index-uuid>?accept_data_loss=true | ||
-------------------------------------------------- | ||
// TEST[skip:Difficult to set up] | ||
|
||
[[dangling-index-delete-api-desc]] | ||
==== {api-description-title} | ||
|
||
include::{es-repo-dir}/indices/dangling-indices-list.asciidoc[tag=dangling-index-description] | ||
|
||
|
||
Deletes a dangling index by referencing its UUID. Use the | ||
<<dangling-indices-list,List dangling indices API>> to locate the UUID of an index. | ||
|
||
|
||
[[dangling-index-delete-api-path-params]] | ||
==== {api-path-parms-title} | ||
|
||
`<index-uuid>`:: | ||
(Required, string) | ||
UUID of the index to delete. You can find this using the | ||
<<dangling-indices-list,List dangling indices API>>. | ||
|
||
[[dangling-index-delete-api-query-params]] | ||
==== {api-query-parms-title} | ||
|
||
`accept_data_loss`:: | ||
(Optional, boolean) | ||
This field must be set to `true` in order to carry out the import, since it will | ||
no longer be possible to recover the data from the dangling index. | ||
|
||
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeout] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
[[dangling-index-import]] | ||
=== Import dangling index API | ||
++++ | ||
<titleabbrev>Import dangling index</titleabbrev> | ||
++++ | ||
|
||
Imports a dangling index. | ||
|
||
[[dangling-index-import-api-request]] | ||
==== {api-request-title} | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
POST /_dangling/<index-uuid>?accept_data_loss=true | ||
-------------------------------------------------- | ||
// TEST[skip:Difficult to set up] | ||
|
||
[[dangling-index-import-api-desc]] | ||
==== {api-description-title} | ||
|
||
include::{es-repo-dir}/indices/dangling-indices-list.asciidoc[tag=dangling-index-description] | ||
|
||
Import a single index into the cluster by referencing its UUID. Use the | ||
<<dangling-indices-list,List dangling indices API>> to locate the UUID of an index. | ||
|
||
|
||
[[dangling-index-import-api-path-params]] | ||
==== {api-path-parms-title} | ||
|
||
`<index-uuid>`:: | ||
(Required, string) | ||
UUID of the index to import, which you can find using the | ||
<<dangling-indices-list,List dangling indices API>>. | ||
|
||
[[dangling-index-import-api-query-params]] | ||
==== {api-query-parms-title} | ||
|
||
`accept_data_loss`:: | ||
(Required, boolean) | ||
This field must be set to `true` to import a dangling index. Because {es} | ||
cannot know where the dangling index data came from or determine which shard | ||
copies are fresh and which are stale, it cannot guarantee that the imported data | ||
represents the latest state of the index when it was last in the cluster. | ||
|
||
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeout] | ||
|
||
[[dangling-index-import-api-example]] | ||
==== {api-examples-title} | ||
|
||
The following example shows how to import a dangling index: | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
POST /_dangling/zmM4e0JtBkeUjiHD-MihPQ?accept_data_loss=true | ||
-------------------------------------------------- | ||
// TEST[skip:Difficult to set up] | ||
|
||
The API returns following response: | ||
|
||
[source,console-result] | ||
-------------------------------------------------- | ||
{ | ||
"acknowledged" : true | ||
} | ||
-------------------------------------------------- |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
[[dangling-indices-list]] | ||
=== List dangling indices API | ||
++++ | ||
<titleabbrev>List dangling indices</titleabbrev> | ||
++++ | ||
|
||
Lists dangling indices. | ||
|
||
[[dangling-indices-list-api-request]] | ||
==== {api-request-title} | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
GET /_dangling | ||
-------------------------------------------------- | ||
// TEST[skip:TBD] | ||
|
||
[[dangling-indices-list-api-desc]] | ||
==== {api-description-title} | ||
|
||
// tag::dangling-index-description[] | ||
If {es} encounters index data that is absent from the current cluster | ||
state, those indices are considered to be dangling. For example, | ||
this can happen if you delete more than | ||
`cluster.indices.tombstones.size` indices while an {es} node is offline. | ||
// end::dangling-index-description[] | ||
|
||
Use this API to list dangling indices, which you can then | ||
<<dangling-index-import,import>> or <<dangling-index-delete,delete>>. | ||
|
||
|
||
[[dangling-indices-list-api-example]] | ||
==== {api-examples-title} | ||
|
||
The API returns the following response: | ||
|
||
[source,console-result] | ||
-------------------------------------------------- | ||
{ | ||
"dangling_indices": [ | ||
"index_name": "twitter", | ||
"index_uuid": "zmM4e0JtBkeUjiHD-MihPQ", | ||
"creation_date_millis": 1589414451372, | ||
"node_ids": [ | ||
"pL47UN3dAb2d5RCWP6lQ3e" | ||
] | ||
] | ||
} | ||
-------------------------------------------------- |
This file contains 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
This file contains 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
This file contains 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