bbejeck commented on code in PR #22754:
URL: https://github.com/apache/kafka/pull/22754#discussion_r3572928135


##########
streams/src/main/java/org/apache/kafka/streams/state/internals/AbstractRocksDBSegmentedBytesStore.java:
##########
@@ -316,11 +327,23 @@ public void init(final StateStoreContext 
stateStoreContext, final StateStore roo
                 stateStoreContext.appConfigs(),
                 IQ_CONSISTENCY_OFFSET_VECTOR_ENABLED,
                 false);
+
+        transactional = StreamsConfig.InternalConfig.getBoolean(
+                stateStoreContext.appConfigs(),
+                StreamsConfig.TRANSACTIONAL_STATE_STORES_CONFIG,
+                false);
     }
 
     @Override
     public void commit(final Map<TopicPartition, Long> changelogOffsets) {
-        segments.commit(changelogOffsets);
+        synchronized (position) {
+            if (transactional) {
+                // Publish the staged position atomically with the 
segment-buffer flush below.
+                position.merge(pendingPosition);
+                pendingPosition = Position.emptyPosition();

Review Comment:
   I think this line needs to go into `close()` and `init()` as well



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