gabriellefu commented on code in PR #23184:
URL: https://github.com/apache/kafka/pull/23184#discussion_r3815001452
##########
streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBStore.java:
##########
@@ -536,21 +536,25 @@ public <R> QueryResult<R> query(
final PositionBound positionBound,
final QueryConfig config) {
- synchronized (position) {
- final Position queryPosition;
- if (config.getIsolationLevel() == IsolationLevel.READ_COMMITTED) {
- queryPosition = position;
- } else {
- queryPosition =
position.copy().merge(dbAccessor.uncommittedPositionDeltas());
+ // Lock order must match the write paths (store monitor, then
position),
+ // otherwise concurrent put/query can deadlock (KAFKA-19629).
+ synchronized (this) {
Review Comment:
I added one test for this, thanks
--
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]