nicktelford commented on code in PR #23728:
URL: https://github.com/apache/kafka/pull/23728#discussion_r4381118264
##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java:
##########
@@ -1295,8 +1296,17 @@ void runOnceWithoutProcessingThreads() {
checkStateUpdater();
- log.debug("Processing tasks with {} iterations.",
numIterations);
- final int processed = taskManager.process(numIterations, time);
+ // maybeCommit() commits at the end of every iteration when
the uncommitted bytes exceed the limit, so
+ // they only exceed it here when that commit was skipped
(during a rebalance) or failed
+ final boolean processingPaused =
maybePauseProcessingForUncommittedBytes();
Review Comment:
Good catch. I've pushed a fix for this, along with a rebase against latest
trunk. The fix is simply to add:
```java
if (stateMgr.approximateNumUncommittedBytes() > 0) {
commitNeeded = true;
}
```
to `StreamTask`, immediately after `initializeTopology();`. This ensures
that, in the event that initializing the topology and its processors writes
data to the transaction buffers, a commit is immediately requested. Since
`approximateNumUncommittedBytes() > 0` requires data to be in the transaction
buffers, this implicitly requires transactional state stores to be enabled to
have any effect.
--
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]