Failed shard recovery can cause shard data to be deleted (replicas will still work), closes #1227.

This commit is contained in:
Shay Banon 2011-08-10 20:29:24 +03:00
parent 80f9ea5bfe
commit d25c939b97
1 changed files with 4 additions and 2 deletions

View File

@ -281,10 +281,12 @@ public class IndicesClusterStateService extends AbstractLifecycleComponent<Indic
}
indexService.removeShard(existingShardId, "removing shard (index is closed)");
} else {
// we can just remove the shard, without cleaning it locally, since we will clean it
// when all shards are allocated in the IndicesStore
if (logger.isDebugEnabled()) {
logger.debug("[{}][{}] cleaning shard locally (not allocated)", index, existingShardId);
logger.debug("[{}][{}] removing shard (not allocated)", index, existingShardId);
}
indexService.cleanShard(existingShardId, "cleaning shard locally (not allocated)");
indexService.removeShard(existingShardId, "removing shard (not allocated)");
}
}
}