diff --git a/server/src/main/java/org/opensearch/index/store/remote/utils/TransferManager.java b/server/src/main/java/org/opensearch/index/store/remote/utils/TransferManager.java index 237062673bf10..991d3af1ce882 100644 --- a/server/src/main/java/org/opensearch/index/store/remote/utils/TransferManager.java +++ b/server/src/main/java/org/opensearch/index/store/remote/utils/TransferManager.java @@ -97,7 +97,7 @@ private static FileCachedIndexInput createIndexInput(FileCache fileCache, Stream try { // This local file cache is ref counted and may not strictly enforce configured capacity. // If we find available capacity is exceeded, deny further BlobFetchRequests. - if (fileCache.capacity() < fileCache.usage().usage() + request.getBlobLength() && !fileCache.canOverflow()) { + if (fileCache.capacity() < fileCache.usage().usage() && !fileCache.canOverflow()) { fileCache.prune(); throw new IOException("Local file cache capacity exceeded - BlobFetchRequest failed: " + request.getFilePath()); }