Skip to content

Commit 32a7a66

Browse files
diwasjoshibleskes
authored andcommitted
index name added to snapshot restore exception (#29604)
This PR adds index name to snapshot restore exception if index is renamed during restoring. closes [#27601](#27601)
1 parent 4d7aa37 commit 32a7a66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ private void validateExistingIndex(IndexMetaData currentIndexMetaData, IndexMeta
371371
// Make sure that the number of shards is the same. That's the only thing that we cannot change
372372
if (currentIndexMetaData.getNumberOfShards() != snapshotIndexMetaData.getNumberOfShards()) {
373373
throw new SnapshotRestoreException(snapshot, "cannot restore index [" + renamedIndex + "] with [" + currentIndexMetaData.getNumberOfShards() +
374-
"] shard from snapshot with [" + snapshotIndexMetaData.getNumberOfShards() + "] shards");
374+
"] shards from a snapshot of index [" + snapshotIndexMetaData.getIndex().getName() + "] with [" + snapshotIndexMetaData.getNumberOfShards() + "] shards");
375375
}
376376
}
377377

0 commit comments

Comments
 (0)