The change #57936 introduced a dedicated thread pool for reads in system indices. It also introduced a potential NPE in the case the index to read in not yet present in the cluster state. This commit fixes that bug by using the getIndexSafe() instead of just index() method when retrieving the index's metadata so that an INFE is thrown if the index does not exist.
This commit is contained in:
parent
2547cfbe54
commit
6e944d9e21
|
@ -116,7 +116,7 @@ public class TransportGetAction extends TransportSingleShardAction<GetRequest, G
|
||||||
@Override
|
@Override
|
||||||
protected String getExecutor(GetRequest request, ShardId shardId) {
|
protected String getExecutor(GetRequest request, ShardId shardId) {
|
||||||
final ClusterState clusterState = clusterService.state();
|
final ClusterState clusterState = clusterService.state();
|
||||||
if (clusterState.metadata().index(shardId.getIndex()).isSystem()) {
|
if (clusterState.metadata().getIndexSafe(shardId.getIndex()).isSystem()) {
|
||||||
return ThreadPool.Names.SYSTEM_READ;
|
return ThreadPool.Names.SYSTEM_READ;
|
||||||
} else if (indicesService.indexServiceSafe(shardId.getIndex()).getIndexSettings().isSearchThrottled()) {
|
} else if (indicesService.indexServiceSafe(shardId.getIndex()).getIndexSettings().isSearchThrottled()) {
|
||||||
return ThreadPool.Names.SEARCH_THROTTLED;
|
return ThreadPool.Names.SEARCH_THROTTLED;
|
||||||
|
|
Loading…
Reference in New Issue