lucasbru commented on code in PR #24228:
URL: https://github.com/apache/kafka/pull/24228#discussion_r4600733744


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java:
##########
@@ -1565,6 +1558,23 @@ private long pollPhase() {
         return pollLatency;
     }
 
+    /**
+     * Sets the end offset of each partition this poll returned records for, 
or advanced the position of, to the main
+     * consumer's position plus its current lag: the high watermark, or the 
last stable offset under read_committed, of
+     * the partition's latest fetch response. The position can pass the last 
returned record, as control records and
+     * aborted transactions are skipped.
+     */
+    private void updateTaskEndOffsets(final ConsumerRecords<byte[], byte[]> 
records) {

Review Comment:
   This changes what users get from `TaskMetadata#endOffsets()`: it used to be 
the offset of the last fetched record and is now the exclusive end offset, and 
under EOS it's the LSO rather than the HW. Anyone computing lag as `endOffsets 
- committedOffsets` will see it shift by one (more around markers). KIP-715 did 
say HW, so calling it a fix seems fair, but could we spell out the semantics in 
the `TaskMetadata#endOffsets()` javadoc (it only says "End offsets of the 
source topic partitions of the task") and add a line to the upgrade guide?



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

Reply via email to