mjsax commented on code in PR #23991:
URL: https://github.com/apache/kafka/pull/23991#discussion_r4568726315


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StoreChangelogReader.java:
##########
@@ -479,17 +479,17 @@ public Set<TopicPartition> completedChangelogs() {
             .collect(Collectors.toSet());
     }
 
-    // Report a conservative value (higher than the real value) as fallback.
-    // Only "source topic optimized" changelogs have a logical end offset from 
`ChangelogMetadata` (the committed offset on the source topic).
-    // If not known (not set yet, or no "source topic optimization"), fall 
back to physical end offset.
+    // The end offset of each changelog as the next offset to fetch: the 
restore end offset if known (for an active task,

Review Comment:
   > Thanks! Small things: could the javadoc say it's the next offset to fetch, 
e.g. "the end offset of the partition (one past its last offset)"?
   
   Personally, I don't think that necessary because that's the exact definition 
of "end offset", and sounds repetitive to me.
   
   > Now that StateStoreMetadata.endOffset is documented as the last offset, 
the same name meaning two different things is easy to trip over. 
   
   This usage of `endOffset` is just wrong, and it annoys me for a long time 
already... I would rather fix this name (but maybe best to do in a follow up 
PR). If we do this, we should update the below `and otherwise one past the 
store's end offset` accordingly in such a follow up PR.
   
   > Also, for an active task on a source-topic changelog it's the min of the 
end offset and the committed offset (initializeChangelogs), not just the 
committed offset.
   
   Yes, on the top level JavaDocs we use "_logical_ end offset" for this 
reasons; it's a little bit sloppy here -- let me push an update. The 
explanation is already here: `the restore end offset if known (for an active 
task, or the committed offset of a source topic)



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