You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "bbejeck (via GitHub)" <gi...@apache.org> on 2026/03/14 00:04:04 UTC
Re: [PR] KAFKA-19713: Persist Position into offsets CF [kafka]
bbejeck commented on code in PR #21750:
URL: https://github.com/apache/kafka/pull/21750#discussion_r2934044746
##########
streams/src/main/java/org/apache/kafka/streams/state/internals/AbstractRocksDBSegmentedBytesStore.java:
##########
@@ -296,17 +295,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(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:
Same as above
##########
streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBVersionedStore.java:
##########
@@ -366,17 +365,14 @@ public void init(final StateStoreContext stateStoreContext, final StateStore roo
metricsRecorder.init(ProcessorContextUtils.metricsImpl(stateStoreContext), stateStoreContext.taskId());
- final File positionCheckpointFile = new File(stateStoreContext.stateDir(), name() + ".position");
- positionCheckpoint = new OffsetCheckpoint(positionCheckpointFile);
- position = StoreQueryUtils.readPositionFromCheckpoint(positionCheckpoint);
- segmentStores.setPosition(position);
segmentStores.openExisting(internalProcessorContext, observedStreamTime);
+ this.position = segmentStores.position;
// register and possibly restore the state from the logs
stateStoreContext.register(
root,
(RecordBatchingStateRestoreCallback) RocksDBVersionedStore.this::restoreBatch,
- () -> StoreQueryUtils.checkpointPosition(positionCheckpoint, position)
+ () -> { } // Nothing to do?
Review Comment:
Same as above
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org