Browse Source

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](https://github.com/elastic/elasticsearch/issues/27601)
Diwas Joshi 7 years ago
parent
commit
dd5fcb211d

+ 1 - 1
server/src/main/java/org/elasticsearch/snapshots/RestoreService.java

@@ -412,7 +412,7 @@ public class RestoreService extends AbstractComponent implements ClusterStateApp
                     // Make sure that the number of shards is the same. That's the only thing that we cannot change
                     if (currentIndexMetaData.getNumberOfShards() != snapshotIndexMetaData.getNumberOfShards()) {
                         throw new SnapshotRestoreException(snapshot, "cannot restore index [" + renamedIndex + "] with [" + currentIndexMetaData.getNumberOfShards() +
-                                "] shard from snapshot with [" + snapshotIndexMetaData.getNumberOfShards() + "] shards");
+                                "] shards from a snapshot of index [" + snapshotIndexMetaData.getIndex().getName() + "] with [" + snapshotIndexMetaData.getNumberOfShards() + "] shards");
                     }
                 }