Skip to content

Commit df1883d

Browse files
committed
Fix snapshot restore logging on fresh restore (#40252)
A recent refactoring (#37130) where imports got mixed up (changing Lucene's IndexNotFoundException to Elasticsearch's IndexNotFoundException) led to many warnings being logged in case of restoring a fresh snapshot.
1 parent d5b26a4 commit df1883d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

server/src/main/java/org/elasticsearch/repositories/blobstore/FileRestoreContext.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import org.apache.lucene.util.BytesRefBuilder;
3232
import org.elasticsearch.common.lucene.Lucene;
3333
import org.elasticsearch.common.util.iterable.Iterables;
34-
import org.elasticsearch.index.IndexNotFoundException;
3534
import org.elasticsearch.index.shard.IndexShard;
3635
import org.elasticsearch.index.shard.ShardId;
3736
import org.elasticsearch.index.snapshots.IndexShardRestoreFailedException;
@@ -119,7 +118,7 @@ public void restore(SnapshotFiles snapshotFiles) throws IOException {
119118
// store can still have existing files but they will be deleted just before being
120119
// restored.
121120
recoveryTargetMetadata = indexShard.snapshotStoreMetadata();
122-
} catch (IndexNotFoundException e) {
121+
} catch (org.apache.lucene.index.IndexNotFoundException e) {
123122
// happens when restore to an empty shard, not a big deal
124123
logger.trace("[{}] [{}] restoring from to an empty shard", shardId, snapshotId);
125124
recoveryTargetMetadata = Store.MetadataSnapshot.EMPTY;

0 commit comments

Comments
 (0)