KAFKA-20498: Add isolation-level reads to RocksDBStore#22653
Open
nicktelford wants to merge 1 commit into
Open
KAFKA-20498: Add isolation-level reads to RocksDBStore#22653nicktelford wants to merge 1 commit into
nicktelford wants to merge 1 commit into
Conversation
Override readOnly(IsolationLevel) on RocksDBStore to return a view bound to a specific DBAccessor so interactive-query callers can select the read strategy. READ_COMMITTED on a transactional store reads through the underlying DirectDBAccessor, bypassing the transaction buffer; READ_UNCOMMITTED (and the default for non-transactional stores) uses the active accessor, preserving existing semantics. The view shares cfAccessor and openIterators with the store, so reads go through the same iterator-tracking path while writes are not exposed. Add readOnly(IsolationLevel) semantic tests covering get, range/all, and prefixScan, reopening the store under an EOS context with enable.transactional.statestores=true to exercise the transaction buffer. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
bbejeck
reviewed
Jun 24, 2026
bbejeck
left a comment
Member
There was a problem hiding this comment.
Thanks @nicktelford LGTM, can we get a test or two for reverse iteration?
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.
Interactive queries against a transactional RocksDB store (EOS) need to
choose whether they observe writes staged in the current, uncommitted
transaction. This adds a
readOnly(IsolationLevel)override toRocksDBStorethat returns a view bound to a specificDBAccessor:READ_COMMITTEDreads through the underlyingDirectDBAccessor,bypassing the transaction buffer, so the query sees only committed data;
READ_UNCOMMITTED(and the default for non-transactional stores) usesthe active accessor, preserving existing behaviour.
The returned
ReadOnlyViewsharescfAccessorandopenIteratorswiththe store, so reads go through the same iterator-tracking path while the
view exposes no writes.
Includes
readOnly(IsolationLevel)semantic tests coveringget,range/all, andprefixScanthat stage writes without committing andassert the
READ_COMMITTED/READ_UNCOMMITTEDdivergence, reopening thestore under an EOS context with
enable.transactional.statestores=trueto exercise the transaction buffer.
🤖 Generated with Claude Code
Reviewers: Bill Bejeck bbejeck@apache.org