Skip to content

cat/indices no longer shows indices currently being restored #39933

@sophiec20

Description

@sophiec20

Elasticsearch version (bin/elasticsearch --version):
Version: 8.0.0-SNAPSHOT, Build: default/tar/4957cad/2019-03-11T15:48:39.514013Z, JVM: 1.8.0_151

Plugins installed: []
repository_gcs

JVM version (java -version):

OS version (uname -a if on a Unix-like system):

Description of the problem including expected versus actual behavior:

This is a usability nit.

Restoring a large snapshot may take some time. During this period you can no longer see the restoring indices listed in GET _cat/indices therefore you may think that the restore might not have been initiated.

If you re-run the restore command, you get the error below saying that the index already exists.

This is a change from 6.x where the indices would be listed immediately by GET _cat/indices with their health as yellow. This was a convenient way to see that the restoration was in progress, especially for snapshots with multiple indices.

Perhaps the index list behaviour could be returned to previous, or a more useful error message be displayed to explain that the restore is in progress.

{
  "error": {
    "root_cause": [
      {
        "type": "snapshot_restore_exception",
        "reason": "[my_repo:a_large_snapshot/fYI6EIhEQYm0E_tbDiOEgA] cannot restore index [filebeat-2019] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name"
      }
    ],
    "type": "snapshot_restore_exception",
    "reason": "[my_repo:a_large_snapshot/fYI6EIhEQYm0E_tbDiOEgA] cannot restore index [filebeat-2019] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name"
  },
  "status": 500
}

Found in 3 node cluster.

Steps to reproduce:

Please include a minimal but complete recreation of the problem, including
(e.g.) index creation, mappings, settings, query etc. The easier you make for
us to reproduce it, the more likely that somebody will take the time to look at it.

  1. POST _snapshot/my_repo/a_large_snapshot/_restore -- restore a large snapshot
  2. GET _cat/indices -- notice indices are not yet listed
  3. POST _snapshot/my_repo/a_large_snapshot/_restore -- re-run the restore again, before the first step has had a chance to finish.

Provide logs (if relevant):

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions