Skip to content

Commit a000339

Browse files
committed
add assert
1 parent 0730ea4 commit a000339

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRepository.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ protected void doRun() throws Exception {
456456
final long nanosPaused = ccrSettings.getRateLimiter().maybePause(actualChunkSize);
457457
throttleListener.accept(nanosPaused);
458458
final long newOffset = r.getOffset() + actualChunkSize;
459+
assert newOffset <= fileToRecover.length();
459460
final boolean lastChunk = newOffset >= fileToRecover.length();
460461
multiFileWriter.writeFileChunk(fileToRecover.metadata(), r.getOffset(), r.getChunk(),
461462
lastChunk);

0 commit comments

Comments
 (0)