Skip to content

KAFKA-20498: Add isolation-level reads to RocksDBStore#22653

Open
nicktelford wants to merge 1 commit into
apache:trunkfrom
nicktelford:KIP-892/iq-isolation-rocksdb
Open

KAFKA-20498: Add isolation-level reads to RocksDBStore#22653
nicktelford wants to merge 1 commit into
apache:trunkfrom
nicktelford:KIP-892/iq-isolation-rocksdb

Conversation

@nicktelford

@nicktelford nicktelford commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

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 to
RocksDBStore that returns a view bound to a specific DBAccessor:
READ_COMMITTED reads through the underlying DirectDBAccessor,
bypassing the transaction buffer, so the query sees only committed data;
READ_UNCOMMITTED (and the default for non-transactional stores) uses
the active accessor, preserving existing behaviour.

The returned ReadOnlyView shares cfAccessor and openIterators with
the store, so reads go through the same iterator-tracking path while the
view exposes no writes.

Includes readOnly(IsolationLevel) semantic tests covering get,
range/all, and prefixScan that stage writes without committing and
assert the READ_COMMITTED/READ_UNCOMMITTED divergence, reopening the
store under an EOS context with enable.transactional.statestores=true
to exercise the transaction buffer.

🤖 Generated with Claude Code

Reviewers: Bill Bejeck bbejeck@apache.org

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>
@github-actions github-actions Bot added triage PRs from the community streams labels Jun 23, 2026
@nicktelford

Copy link
Copy Markdown
Contributor Author

@bbejeck

@bbejeck bbejeck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nicktelford LGTM, can we get a test or two for reverse iteration?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

streams triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants