Skip to content

Commit 5ef5712

Browse files
committed
Improve failure message when restoring an index that already exists in the cluster (#28498)
Makes the message more actionable and removes the focus on the fact that the index is open.
1 parent 30ca5b5 commit 5ef5712

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/main/java/org/elasticsearch/snapshots/RestoreService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ private void validateExistingIndex(IndexMetaData currentIndexMetaData, IndexMeta
362362
// Index exist - checking that it's closed
363363
if (currentIndexMetaData.getState() != IndexMetaData.State.CLOSE) {
364364
// TODO: Enable restore for open indices
365-
throw new SnapshotRestoreException(snapshot, "cannot restore index [" + renamedIndex + "] because it's open");
365+
throw new SnapshotRestoreException(snapshot, "cannot restore index [" + renamedIndex + "] because an open index with same name already exists in the cluster. " +
366+
"Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name");
366367
}
367368
// Index exist - checking if it's partial restore
368369
if (partial) {

0 commit comments

Comments
 (0)