Dangling indexes API

Introduced 1.0

After a node joins a cluster, dangling indexes occur if any shards exist in the node’s local directory that do not already exist in the cluster. Dangling indexes can be listed, deleted, or imported.

Path and HTTP methods

List dangling indexes:

  1. GET /_dangling

Import a dangling index:

  1. POST /_dangling/<index-uuid>

Delete a dangling index:

  1. DELETE /_dangling/<index-uuid>

Path parameters

Path parameters are required.

Path parameterDescription
index-uuidUUID of index.

Query parameters

Query parameters are optional.

Query parameterData typeDescription
accept_data_lossBooleanMust be set to true for an import or delete because OpenSearch is unaware of where the dangling index data came from.
timeoutTime unitsThe amount of time to wait for a response. If no response is received in the defined time period, an error is returned. Default is 30 seconds.
cluster_manager_timeoutTime unitsThe amount of time to wait for a connection to the cluster manager. If no response is received in the defined time period, an error is returned. Default is 30 seconds.

Examples

The following are example requests and a example response.

Sample list

  1. GET /_dangling

copy

Sample import

  1. POST /_dangling/msdjernajxAT23RT-BupMB?accept_data_loss=true

copy

Sample delete

  1. DELETE /_dangling/msdjernajxAT23RT-BupMB?accept_data_loss=true

Example response body

  1. {
  2. "_nodes": {
  3. "total": 1,
  4. "successful": 1,
  5. "failed": 0
  6. },
  7. "cluster_name": "opensearch-cluster",
  8. "dangling_indices": [msdjernajxAT23RT-BupMB]
  9. }