protect a bit more from bogus (not relevant) exceptions when closing a node
This commit is contained in:
parent
377914bd07
commit
37b33cf77d
|
@ -334,7 +334,11 @@ public class IndicesClusterStateService extends AbstractLifecycleComponent<Indic
|
||||||
}
|
}
|
||||||
List<String> typesToRefresh = null;
|
List<String> typesToRefresh = null;
|
||||||
String index = indexMetaData.index();
|
String index = indexMetaData.index();
|
||||||
IndexService indexService = indicesService.indexServiceSafe(index);
|
IndexService indexService = indicesService.indexService(index);
|
||||||
|
if (indexService == null) {
|
||||||
|
// got deleted on us, ignore (closing the node)
|
||||||
|
return;
|
||||||
|
}
|
||||||
MapperService mapperService = indexService.mapperService();
|
MapperService mapperService = indexService.mapperService();
|
||||||
// first, go over and update the _default_ mapping (if exists)
|
// first, go over and update the _default_ mapping (if exists)
|
||||||
if (indexMetaData.mappings().containsKey(MapperService.DEFAULT_MAPPING)) {
|
if (indexMetaData.mappings().containsKey(MapperService.DEFAULT_MAPPING)) {
|
||||||
|
@ -523,7 +527,11 @@ public class IndicesClusterStateService extends AbstractLifecycleComponent<Indic
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyInitializingShard(final RoutingTable routingTable, final DiscoveryNodes nodes, final IndexShardRoutingTable indexShardRouting, final ShardRouting shardRouting) throws ElasticSearchException {
|
private void applyInitializingShard(final RoutingTable routingTable, final DiscoveryNodes nodes, final IndexShardRoutingTable indexShardRouting, final ShardRouting shardRouting) throws ElasticSearchException {
|
||||||
final IndexService indexService = indicesService.indexServiceSafe(shardRouting.index());
|
final IndexService indexService = indicesService.indexService(shardRouting.index());
|
||||||
|
if (indexService == null) {
|
||||||
|
// got deleted on us, ignore
|
||||||
|
return;
|
||||||
|
}
|
||||||
final int shardId = shardRouting.id();
|
final int shardId = shardRouting.id();
|
||||||
|
|
||||||
if (indexService.hasShard(shardId)) {
|
if (indexService.hasShard(shardId)) {
|
||||||
|
|
Loading…
Reference in New Issue