kamalcph commented on code in PR #13561:
URL: https://github.com/apache/kafka/pull/13561#discussion_r1293081560


##########
core/src/main/java/kafka/log/remote/RemoteLogManager.java:
##########
@@ -618,6 +625,230 @@ public void run() {
             }
         }
 
+        public void handleLogStartOffsetUpdate(TopicPartition topicPartition, 
long remoteLogStartOffset) {
+            if (isLeader()) {

Review Comment:
   In the FETCH response, the leader-log-start-offset will be piggy-backed. 
But, there can be a scenario:
   
   1. Leader deleted the remote log segment and updates it's log-start-offset
   2. Before the replica-2 update it's log-start-offset via FETCH-request, the 
leadership changed to replica-2.
   3. There are no more eligible segments to delete from remote.
   4. The log-start-offset will be stale (referring to old log-start-offset but 
the data was already removed from remote)
   5. If the consumer starts to read from the beginning of the topic, it will 
fail to read.
   
   It's good to handle this case in this PR itself.



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