diff --git a/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBlobCacheService.java b/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBlobCacheService.java index 4c4752afa0211..374897b30f038 100644 --- a/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBlobCacheService.java +++ b/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBlobCacheService.java @@ -780,11 +780,11 @@ public boolean tryRead(ByteBuffer buf, long offset) throws IOException { } else { fileRegion = cache.get(cacheKey, length, startRegion); } - final var region = fileRegion; - if (region.chunk.tracker.checkAvailable(end - getRegionStart(startRegion)) == false) { + final var region = fileRegion.chunk; + if (region.tracker.checkAvailable(end - getRegionStart(startRegion)) == false) { return false; } - boolean res = region.chunk.tryRead(buf, offset); + boolean res = region.tryRead(buf, offset); lastAccessedRegion = res ? fileRegion : null; return res; }