[improve][metadata] Add partition key resolver support for Oxia index scans#26148
Open
void-ptr974 wants to merge 1 commit into
Open
[improve][metadata] Add partition key resolver support for Oxia index scans#26148void-ptr974 wants to merge 1 commit into
void-ptr974 wants to merge 1 commit into
Conversation
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.
Motivation
Oxia records can be routed with
PartitionKey. Native secondary-index scans return primary paths, and some callers can derive the routing key from each returned path. A single scan-levelPartitionKeyonly covers scans scoped to one routing key; it does not cover scans that may span multiple routing keys.For example, transaction op records are stored under
/txn/op/<txnId>-<seq>withPartitionKey(txnId). A scan by segment can return op records for multiple transaction IDs, so each follow-up primary read can use the transaction ID derived from the returned path.This PR adds an option for passing that per-result routing hint and uses it in transaction metadata index scans.
Modifications
Option.PartitionKeyResolverto derive a concretePartitionKeyfrom a primary path discovered during a scan.PartitionKeybefore Oxia loads each primary record returned byscanByIndex.Verifying this change
This change added tests and can be verified as follows:
./gradlew :pulsar-metadata:compileTestJava :pulsar-broker:compileJava :pulsar-metadata:checkstyleMain :pulsar-metadata:checkstyleTest :pulsar-broker:checkstyleMain -x :managed-ledger:compileTestJava./gradlew :pulsar-metadata:test --tests org.apache.pulsar.metadata.OxiaPartitionKeyTestDoes this pull request potentially affect one of the following parts:
This adds a new metadata-store
Optionsubtype. It does not change existing option behavior, configuration defaults, wire protocol, or metadata format.