Recovery: don't log an error when listing an empty folder

This commit is contained in:
Boaz Leskes 2016-08-04 10:23:36 +02:00
parent 146f02183d
commit d327dd46b1
1 changed files with 3 additions and 0 deletions

View File

@ -174,6 +174,9 @@ public class RecoveryTargetService extends AbstractComponent implements IndexEve
} else {
metadataSnapshot = recoveryTarget.indexShard().snapshotStoreMetadata();
}
} catch (org.apache.lucene.index.IndexNotFoundException e) {
// happens on an empty folder. no need to log
metadataSnapshot = Store.MetadataSnapshot.EMPTY;
} catch (IOException e) {
logger.warn("error while listing local files, recover as if there are none", e);
metadataSnapshot = Store.MetadataSnapshot.EMPTY;