lucasbru commented on code in PR #22595:
URL: https://github.com/apache/kafka/pull/22595#discussion_r3435919146
##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/DefaultStateUpdater.java:
##########
@@ -442,6 +448,36 @@ private void
addToExceptionsAndFailedTasksThenClearUpdatingAndPausedTasks(final
}
}
+ private void updateTaskOffsetSumSnapshot() {
+ final Map<StreamsRebalanceData.TaskId, Long> snapshot = new
HashMap<>(updatingTasks.size());
+ for (final Task task : updatingTasks.values()) {
+ if (task.changelogPartitions().isEmpty()) {
+ continue;
+ }
+ long sum = 0L;
+ boolean unknownOffsetFound = false;
+ for (final Long offset : task.changelogOffsets().values()) {
+ if (offset == null || offset == OFFSET_UNKNOWN) {
+ unknownOffsetFound = true;
+ continue;
+ }
+ if (sum > Long.MAX_VALUE - offset) {
+ sum = Long.MAX_VALUE;
+ break;
+ }
+ sum += offset;
+ }
+ if (unknownOffsetFound && sum != Long.MAX_VALUE) {
Review Comment:
Sounds like a valid approach
--
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]