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


##########
streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBStore.java:
##########
@@ -531,12 +531,20 @@ public <R> QueryResult<R> query(
         final PositionBound positionBound,
         final QueryConfig config) {
 
+        final Position queryPosition;
+        synchronized (position) {
+            if (config.getIsolationLevel() == IsolationLevel.READ_COMMITTED) {
+                queryPosition = position.copy();

Review Comment:
   My interpretation of this is that `handleBasicQueries` synchronizes on 
`Position` so that no updates can happen to the underlying store during a 
query, primarily to ensure the `Position` correctly reflects the state visible 
to the query.
   
   By taking an eager snapshot of the `Position` here, but _not_ taking a 
snapshot of the store state, the two could drift apart.
   
   I'll have a think about how this can be fixed.



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