nicktelford opened a new pull request, #22597:
URL: https://github.com/apache/kafka/pull/22597

   Introduces the `statestore.uncommitted.max.bytes` config, which triggers an 
early commit when the total uncommitted bytes across all transactional state 
stores on a thread exceeds the configured limit, regardless of 
`commit.interval.ms`. This bounds the memory consumed by pending write buffers 
under high write throughput.
   
   The limit is divided equally across StreamThreads and the 
GlobalStreamThread. Each thread independently enforces its share: StreamThreads 
trigger an early task commit via `maybeCommit()`; the GlobalStreamThread 
flushes at the end of each `pollAndUpdate()` cycle.
   
   `StateStore` gains a default `approximateNumUncommittedBytes()` method 
(returning 0); adapter and wrapper classes delegate to the inner store. Metered 
key-value stores register an uncommitted-bytes gauge. Segmented and versioned 
stores aggregate across their underlying segments.
   
   The per-thread limit is recomputed whenever stream threads are dynamically 
added or removed via `addStreamThread()`/`removeStreamThread()`, mirroring the 
existing thread-cache resize logic. The per-thread limit field is `volatile` so 
running threads pick up the new value on their next commit check without 
synchronisation.
   
   This is part of 
[KIP-892](https://cwiki.apache.org/confluence/display/KAFKA/KIP-892%3A+Transactional+Semantics+for+State+Stores),
 stacked on #22323 (KAFKA-20490, merged).


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