mjsax commented on code in PR #23991:
URL: https://github.com/apache/kafka/pull/23991#discussion_r4568847610
##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StoreChangelogReader.java:
##########
@@ -800,7 +801,11 @@ private void maybeAdvanceStandbyRestoredOffset(final
ProcessorStateManager state
// the next offset to fetch, not last-applied
final OptionalLong lag = restoreConsumer.currentLag(partition);
if (lag.isPresent() && lag.getAsLong() == 0L) {
- stateManager.advanceRestoredOffsetTo(storeMetadata,
restoreConsumer.position(partition, Duration.ZERO));
+ final long position = restoreConsumer.position(partition,
Duration.ZERO);
+ stateManager.advanceRestoredOffsetTo(storeMetadata,
position);
+ // the end offset is otherwise only learned from a
restored batch, which never comes when
+ // there is nothing to restore; like there, it is the last
offset, -1 for an empty changelog
+ storeMetadata.setEndOffset(position - 1L);
Review Comment:
https://issues.apache.org/jira/browse/KAFKA-21506
--
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]