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


##########
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:
   With a per-thread limit below the aggregate empty-batch overhead (for 
example, a one-byte limit with a transactional RocksDB store), this guard 
pauses processing and punctuation indefinitely, even without a rebalance. 
`RocksDBTransactionBuffer.approximateNumUncommittedBytes()` includes the fixed 
header of an empty `WriteBatch`, and successful commits recreate that nonzero 
baseline rather than clearing the condition. Exclude empty-batch overhead from 
the shared byte accounting and add a real-store regression test with a limit 
below that baseline.



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