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


##########
streams/src/main/java/org/apache/kafka/streams/state/internals/AbstractDualSchemaRocksDBSegmentedBytesStore.java:
##########
@@ -254,18 +253,14 @@ public void init(final StateStoreContext 
stateStoreContext, final StateStore roo
             metrics
         );
 
-        final File positionCheckpointFile = new 
File(stateStoreContext.stateDir(), name() + ".position");
-        this.positionCheckpoint = new OffsetCheckpoint(positionCheckpointFile);
-        this.position = 
StoreQueryUtils.readPositionFromCheckpoint(positionCheckpoint);
-        segments.setPosition(this.position);
-
         segments.openExisting(internalProcessorContext, observedStreamTime);
+        this.position = segments.position;
 
         // register and possibly restore the state from the logs
         stateStoreContext.register(
             root,
             (RecordBatchingStateRestoreCallback) this::restoreAllInternal,
-            () -> StoreQueryUtils.checkpointPosition(positionCheckpoint, 
position)
+            () -> { } // Nothing to do?

Review Comment:
   Write the position here, since on open/read we merge positions for all 
segments. Plus the cost is small since it's small entry.   Same for the other 
callbacks



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