guozhangwang commented on a change in pull request #10894:
URL: https://github.com/apache/kafka/pull/10894#discussion_r653896503
##########
File path:
streams/src/main/java/org/apache/kafka/streams/processor/internals/GlobalStateManagerImpl.java
##########
@@ -288,6 +288,19 @@ private void restoreState(final StateRestoreCallback
stateRestoreCallback,
// -> don't pass in `task.timeout.ms` to stay responsive if
`KafkaStreams#close` gets called
final ConsumerRecords<byte[], byte[]> records =
globalConsumer.poll(requestTimeoutPlusTaskTimeout);
if (records.isEmpty()) {
+ // get consumer position to step over potential TX markers
+ offset = retryUntilSuccessOrThrowOnTaskTimeout(
+ () -> globalConsumer.position(topicPartition),
+ String.format(
+ "Failed to get position for partition %s. The
broker may be transiently unavailable at the moment.",
+ topicPartition
+ )
+ );
+
+ if (offset == highWatermark) {
Review comment:
very nit: maybe `>=`?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]