mimaison commented on code in PR #23258:
URL: https://github.com/apache/kafka/pull/23258#discussion_r3861285829
##########
storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java:
##########
@@ -216,6 +225,9 @@ public boolean resize(int newSize) throws IOException {
mmap =
raf.getChannel().map(FileChannel.MapMode.READ_WRITE, 0, roundedNewSize);
this.maxEntries = mmap.limit() / entrySize();
mmap.position(position);
+ if (sync) {
+ raf.getChannel().force(true);
Review Comment:
Maybe my comment `fsync the file after resizing to ensure both content and
size are durable` is confusing. This method only touches metadata (length) and
my concern was to ensure metadata are flushed.
The content should already have been flushed from `LogSegment.flush()`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]