Log warn message if leftover shard is detected

This commit is contained in:
Simon Willnauer 2015-06-23 14:12:29 +02:00
parent a3d1a50865
commit 79f3e78ce2
1 changed files with 1 additions and 0 deletions

View File

@ -92,6 +92,7 @@ public final class ShardPath {
ShardStateMetaData load = ShardStateMetaData.FORMAT.loadLatestState(logger, path); ShardStateMetaData load = ShardStateMetaData.FORMAT.loadLatestState(logger, path);
if (load != null) { if (load != null) {
if ((load.indexUUID.equals(indexUUID) || IndexMetaData.INDEX_UUID_NA_VALUE.equals(load.indexUUID)) == false) { if ((load.indexUUID.equals(indexUUID) || IndexMetaData.INDEX_UUID_NA_VALUE.equals(load.indexUUID)) == false) {
logger.warn("{} found shard on path: [{}] with a different index UUID - this shard seems to be leftover from a different index with the same name. Remove the leftover shard in order to reuse the path with the current index", shardId, path);
throw new IllegalStateException(shardId + " index UUID in shard state was: " + load.indexUUID + " expected: " + indexUUID + " on shard path: " + path); throw new IllegalStateException(shardId + " index UUID in shard state was: " + load.indexUUID + " expected: " + indexUUID + " on shard path: " + path);
} }
if (loadedPath == null) { if (loadedPath == null) {