core/mvcc/logical-log: drain consumed bytes on read_more_data

This commit is contained in:
Pere Diaz Bou
2025-09-25 13:31:03 +02:00
parent 7b131b0b0d
commit b75eb9f09d

View File

@@ -413,6 +413,10 @@ impl StreamingLogicalLogReader {
let c = self.file.pread(self.offset as u64, c)?;
io.wait_for_completion(c)?;
self.offset += to_read;
// cleanup consumed bytes
// this could be better for sure
let _ = self.buffer.borrow_mut().drain(0..self.buffer_offset);
self.buffer_offset = 0;
Ok(())
}