KAFKA-20500: Add isolation-level reads to versioned stores#22682
Open
nicktelford wants to merge 1 commit into
Open
KAFKA-20500: Add isolation-level reads to versioned stores#22682nicktelford wants to merge 1 commit into
nicktelford wants to merge 1 commit into
Conversation
Versioned stores are queryable through IQv2 (VersionedKeyQuery and MultiVersionedKeyQuery) and IQv1, but had no way to honour the configured interactive-query isolation level. When the underlying RocksDBStore is transactional, its accessor consults the staged-write buffer, so a READ_COMMITTED query would incorrectly observe writes that are still only in the current transaction. Extend the readOnly(IsolationLevel) hook the other store families already have to versioned stores. Because versioned stores have no dedicated ReadOnly* parent interface, the default is added directly on VersionedKeyValueStore, and VersionedBytesStore.readOnly is covariantly narrowed so wrapper layers retain the versioned read methods. Reads in RocksDBVersionedStore — single-key latest, point-in-time, and timestamp-range — flow through LogicalKeyValueSegment views bound to a specific DBAccessor, so READ_COMMITTED bypasses the transaction buffer via the direct accessor. The metered and change-logging versioned wrappers gain matching readOnly overrides, and StoreQueryUtils dispatches versioned key queries through readOnly(isolationLevel). Add semantic tests asserting READ_COMMITTED hides staged writes while READ_UNCOMMITTED exposes them across the single-key, point-in-time, and timestamp-range read paths. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
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.
Part of the KIP-892 interactive-query isolation-level series. Versioned stores are queryable through IQv2 (
VersionedKeyQuery,MultiVersionedKeyQuery) and IQv1, but had no way to honour the configured isolation level. When the underlyingRocksDBStoreis transactional its accessor consults the staged-write buffer, so aREAD_COMMITTEDquery would incorrectly observe writes still in the current transaction.This extends the
readOnly(IsolationLevel)hook the other store families already have to versioned stores. Because versioned stores have no dedicatedReadOnly*parent interface, the default is added directly onVersionedKeyValueStore, andVersionedBytesStore.readOnlyis covariantly narrowed so wrapper layers keep the versioned read methods. Reads inRocksDBVersionedStore— single-key latest, point-in-time, and timestamp-range — flow throughLogicalKeyValueSegmentviews bound to a specificDBAccessor, soREAD_COMMITTEDbypasses the transaction buffer via the direct accessor. The metered and change-logging versioned wrappers gain matching overrides, andStoreQueryUtilsdispatches versioned key queries throughreadOnly(isolationLevel).Semantic tests assert that
READ_COMMITTEDhides staged writes whileREAD_UNCOMMITTEDexposes them across the single-key, point-in-time, and timestamp-range read paths.This branched off the now-merged RocksDB isolation-level read work (KAFKA-20498) and now applies directly to trunk.
🤖 Generated with Claude Code