nicktelford commented on code in PR #23728:
URL: https://github.com/apache/kafka/pull/23728#discussion_r4386743512


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java:
##########
@@ -1900,6 +1910,26 @@ int maybeCommit() {
         return committed;
     }
 
+    /**
+     * Records and punctuators both write to the state stores, so while the 
uncommitted bytes exceed the limit, they must
+     * wait for a commit to succeed, or the uncommitted bytes grow without 
bound.
+     *
+     * @return true if processing and punctuation must not run
+     */
+    private boolean maybePauseProcessingForUncommittedBytes() {
+        final boolean paused = shouldCommitDueToUncommittedBytes();

Review Comment:
   The fix is to change 
`RocksDBTransactionBuffer.approximateNumUncommittedBytes()` to only count the 
`WriteBatch` size once it starts containing records.
   
   This also fixes a false-positive introduced in our previous change: we would 
request a commit unconditionally after the topology was initialized, because 
`RocksDBTransactionBuffer.approximateNumUncommittedBytes()` would never be `0`. 
Now it can be, so we now only request an initialization commit if at least one 
record was written by the initialization process.



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