Skip to content

Commit fe84866

Browse files
committed
assert+comment
1 parent 5b7d782 commit fe84866

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBlobCacheService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,8 @@ public int populateAndRead(
10061006
final RangeAvailableHandler reader,
10071007
final RangeMissingHandler writer
10081008
) throws Exception {
1009+
// some cache files can grow after being created, so rangeToWrite can be larger than the initial {@code length}
1010+
assert rangeToWrite.start() >= 0 : rangeToWrite;
10091011
assert assertOffsetsWithinFileLength(rangeToRead.start(), rangeToRead.length(), length);
10101012
// We are interested in the total time that the system spends when fetching a result (including time spent queuing), so we start
10111013
// our measurement here.

0 commit comments

Comments
 (0)