Skip to content

Commit

Permalink
Changing logic to fetch Index shard from shardId
Browse files Browse the repository at this point in the history
Signed-off-by: Sagar Upadhyaya <[email protected]>
  • Loading branch information
sgup432 committed Jan 10, 2024
1 parent 0850e11 commit b6e2c4a
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,8 @@ public IndicesService(
this.analysisRegistry = analysisRegistry;
this.indexNameExpressionResolver = indexNameExpressionResolver;
this.indicesRequestCache = new IndicesRequestCache(settings, (shardId -> {
IndexService indexService = null;
try {
indexService = indexServiceSafe(shardId.getIndex());
} catch (IndexNotFoundException ex) {
IndexService indexService = this.indices.get(shardId.getIndex().getUUID());
if (indexService == null) {
return Optional.empty();
}
return Optional.of(new IndexShardCacheEntity(indexService.getShard(shardId.id())));
Expand Down

0 comments on commit b6e2c4a

Please sign in to comment.