gaurav-narula commented on code in PR #23258:
URL: https://github.com/apache/kafka/pull/23258#discussion_r3861944029
##########
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:
Yes, it was that comment that got me looking :)
> The content should already have been flushed from LogSegment.flush()
IIUC, the flush is invoked in a thread spawned during shutdown at LogManager
at
https://github.com/apache/kafka/blob/1fa934068284f85b7ef06189e658d805604ab709/storage/src/main/java/org/apache/kafka/storage/internals/log/LogManager.java#L884
followed by a `UnifiedLog#close`.
There is however a conditional append to a time index that may happen
_after_ `LogSegment#flush()` and before `TimeIndex#close()` at
`LogSegment#close()`
https://github.com/apache/kafka/blob/1fa934068284f85b7ef06189e658d805604ab709/storage/src/main/java/org/apache/kafka/storage/internals/log/LogSegment.java#L770
which is not fsynced.
--
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]