Skip to content
Closed

1 #18391

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -753,16 +753,22 @@ public void ack(final long firstAckSeqNum, final int ackCount) throws IOExceptio
// as a first implementation we assume that all batches are created from the same page
lock.lock();
try {
boolean wasFull = isFull();

if (containsSeq(headPage, firstAckSeqNum)) {
this.headPage.ack(firstAckSeqNum, ackCount, this.checkpointMaxAcks);
} else {
final int resultIndex = binaryFindPageForSeqnum(firstAckSeqNum);
if (tailPages.get(resultIndex).ack(firstAckSeqNum, ackCount, this.checkpointMaxAcks)) {
this.tailPages.remove(resultIndex);
notFull.signalAll();
}
this.headPage.checkpoint();
}

// If we were full before the ack and are not full anymore, signal that we might not be full
if (wasFull && !isFull()) {
notFull.signalAll();
}
} finally {
lock.unlock();
}
Expand Down