junrao commented on code in PR #20131:
URL: https://github.com/apache/kafka/pull/20131#discussion_r2201522171


##########
storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java:
##########
@@ -48,7 +47,12 @@ private enum SearchResultType {
 
     private static final Logger log = 
LoggerFactory.getLogger(AbstractIndex.class);
 
-    // Serializes all index operations that mutate internal state
+    // Serializes all index operations that mutate internal state.
+    // Readers do not need to acquire this lock because:
+    //  1) They only access published entries and are not affected by 
concurrent writes.

Review Comment:
   How about the following?
   
   Clients only read committed data and are not affected by concurrent 
appends/truncates. In the rare case, when the data is truncated, the follower 
could read inconsistent data. The follower has the logic to ignore the 
inconsistent data through crc and leader epoch.



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to