hachikuji commented on a change in pull request #9482:
URL: https://github.com/apache/kafka/pull/9482#discussion_r514539737



##########
File path: raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java
##########
@@ -329,8 +387,9 @@ private void appendLeaderChangeMessage(LeaderState state, 
long currentTimeMs) {
     }
 
     private void flushLeaderLog(LeaderState state, long currentTimeMs) {
-        log.flush();
+        // We update the end offset before flushing so that parked fetches can 
return sooner

Review comment:
       Yeah, it's ok for followers to see uncommitted or even unflushed data. 
The main thing is that we avoid advancing the high watermark until the fsync 
completes. Note that this is the main reason that we had to do KAFKA-10527. 
Without this fix, it was possible for the leader to continue in the same epoch 
after a start, which means that it could lose and overwrite unflushed data.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to