mjsax commented on code in PR #20512:
URL: https://github.com/apache/kafka/pull/20512#discussion_r2337342109


##########
streams/src/main/java/org/apache/kafka/streams/internals/metrics/OpenIterators.java:
##########
@@ -48,10 +51,11 @@ public OpenIterators(final TaskId taskId,
 
     public void add(final MeteredIterator iterator) {
         openIterators.add(iterator);
+        updateOldestStartTimestamp();
 
         if (openIterators.size() == 1) {

Review Comment:
   I don't think that's a problem. While stores are sharded, each shard is its 
own `StateStore` and thus has an own `OpenIterator` instance. Hence, 
`OpenIterator` should be used by a single `StreamsThreads` and there should not 
be any concurrent usage.
   
   The concurrently issue we fixed is only for the metric, because 
`addOldestOpenIteratorGauge` registers the Gauge `(config, now) -> 
openIterators.first().startTimestamp()` (well, now `(config, now) -> 
oldestStartTimestamp.get()`) which could be used concurrently, when the metric 
is read.



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