spanconfigkvaccessor: implement system span config RPCS#75769
Closed
arulajmani wants to merge 2 commits intocockroachdb:masterfrom
Closed
spanconfigkvaccessor: implement system span config RPCS#75769arulajmani wants to merge 2 commits intocockroachdb:masterfrom
arulajmani wants to merge 2 commits intocockroachdb:masterfrom
Conversation
This patch introduces a new `systemspanconfig.Target` type which is intended as in interemediate representation for system span config targets throughout the `spanconfig` package. It ties together a targeter tenant ID with a targetee tenant ID (along with validation to ensure secondary tenants don't target other tenants). We also reserve a `SystemSpanConfigSpan` at the end of the System range. This allows us to assign special meaning to key-prefixes carved out of this range (when stored in `system.span_configurations`). By ensuring this span is carved at the end of the system range, we can ensure that the host tenant does not install span configurations to this span directly. We define special key prefixes for system span configurations in this range and establish a mapping between a Target <-> span using `Encode` and `Decode` methods. This is useful when we store sysytem span configurations in `system.span_configurations` given its schema. Ditto for reading from the table. We'll make use of the `Target` in upcoming PRs, specifically in the `KVAccessor`, `KVSubscriber`, and (the upcoming) `SystemSpanConfigStore`. The `KVAccessor` will construct `Targets` using tenant information from the context as the targeter tenant. It'll use the `roachpb.SystemSpanConfigTargets` supplied to it by RPCs (See cockroachdb#75615). The encoding/decoding methods will be used when writing to/reading from `system.span_configurations`. While the existing `roachpb.SystemSpanConfigTarget` is sufficient for our use in the `KVAccessor` (which runs on SQL pods), the richer structure is motivated by the desire to also use this type in the `KVSubscriber` (when receiving system span config events) and `SystemSpanConfigStore` (which is an in-memory representation of the system span config state). Down in KV we want to distinguish between a tenant installed system span config on its entire keyspace vs. a host tenant installed system span config over a tenants keyspace. Release note: None
This patch implements `GetSystemSpanConfigEntries` and `UpdateSystemSpanConfigEntries` RPCs. Release note: None
Member
This was referenced Feb 1, 2022
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.
This patch implements
GetSystemSpanConfigEntriesandUpdateSystemSpanConfigEntriesRPCs.Release note: None
First commit from: #75641