KAFKA-20257: GlobalStateManagerImpl delegates offset tracking to stores#21739
Open
nicktelford wants to merge 1 commit intoapache:trunkfrom
Open
KAFKA-20257: GlobalStateManagerImpl delegates offset tracking to stores#21739nicktelford wants to merge 1 commit intoapache:trunkfrom
nicktelford wants to merge 1 commit intoapache:trunkfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bbejeck
approved these changes
Mar 13, 2026
Member
bbejeck
left a comment
There was a problem hiding this comment.
Thanks for the PR @nicktelford - LGTM - just a couple minor questions
| maybeWrappedStore.init(globalProcessorContext, maybeWrappedStore); | ||
|
|
||
| // make sure each topic-partition from checkpointFileCache is associated with a global state store | ||
| checkpointFileCache.keySet().forEach(tp -> { |
Member
There was a problem hiding this comment.
We removed this check an it makes sense since we're moving away from checkpoint files, with the new approach I'm thinking there's no way for this to get out sync now?
| @Test | ||
| public void shouldReadCheckpointOffsets() throws IOException { | ||
| final Map<TopicPartition, Long> expected = writeCheckpoint(); | ||
| writeCheckpoint(); |
Member
There was a problem hiding this comment.
nit: Is there a test for full migration path? i.e. legacy .checkpoint exists → stores get migrated offsets → legacy file deleted might be worth adding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As part of KIP-1035, we want to transition away from task-specific .checkpoint files, and instead delegate offset management to StateStores.
We now have a
LegacyCheckpointingStateStorewrapper to encapsulate the management of offsets forStateStoreimplementations that do not know how to manage their own offsets (i.e. for whichmanagesOffsets() == false).As of KAFKA-20212,
RocksDBStorenow knows how to manage its own offsets, so it will not be wrapped in aLegacyCheckpointingStateStore; only user-defined persistent stores will use this wrapper.Corresponding changes to
ProcessorStateManagerhave been submitted independently, as KAFKA-19712.Until both
ProcessorStateManagerandGlobalStateManagerImplhave been updated, theStateManagerinterface must remain as-is. Therefore, theflushandcheckpointmethods will not be consolidated until a later PR, which will clean up the interface and its usage byTaskand friends.