-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server,roachpb: introduce span config rpcs
Part of #67679; these RPCs are exposed through the `kvtenant.Connector` interface for tenants and also sit on `pkg/server.(*Node)` for the host tenant. The basic type in these RPCs is the `SpanConfig` proto, which is the same as our existing `ZoneConfig` proto but without any inheritance business. // GetSpanConfigsRequest is used to fetch the span configurations // over the specified keyspans. message GetSpanConfigsRequest { // Spans to request the configurations for. The spans listed here // are not allowed to overlap with one another. repeated Span spans = 1 [(gogoproto.nullable) = false]; }; // GetSpanConfigsResponse lists out the span configurations that // overlap with the requested spans. message GetSpanConfigsResponse { // SpanConfigEntries capture the span configurations over the // requested spans. The results for each Span in the matching // GetSpanConfigsRequest are flattened out into a single slice. It's // possible for there to be no configurations for a given span; // there'll simply be no entries for it. repeated SpanConfigEntry span_config_entries = 1 [(gogoproto.nullable) = false]; }; // UpdateSpanConfigsRequest is used to update the span // configurations over the given spans. // // This is a "targeted" API: the spans being deleted are expected to // have been present with the same bounds (same start/end key); the // same is true for spans being updated with new configs. If spans // are being added, they're expected to not overlap with any // existing spans. When divvying up an existing span into multiple // others, callers are expected to delete the old and upsert the new // ones. This can happen as part of the same request; we delete the // spans marked for deletion before upserting whatever was // requested. // // Spans are not allowed to overlap with other spans in the same // list but can across lists. This is necessary to support the // delete+upsert semantics described above. message UpdateSpanConfigsRequest { // ToDelete lists out the spans we want to delete span configs // for. repeated Span to_delete = 1 [(gogoproto.nullable) = false]; // ToUpsert lists out the spans we want to upsert and the configs // we want to upsert with. repeated SpanConfigEntry to_upsert = 2 [(gogoproto.nullable) = false]; }; The RPCs are backed by a new host-tenant only `system.span_configurations` table. Future PRs will wire a view of this table into KV with an eye towards replacing our use of `config.SystemConfig`. CREATE TABLE system.span_configurations ( start_key BYTES NOT NULL PRIMARY KEY, end_key BYTES NOT NULL, config BYTES NOT NULL, UNIQUE INDEX end_key_idx (end_key), CONSTRAINT check_bounds CHECK (start_key < end_key), FAMILY "primary" (start_key, end_key, config) ) --- While here, we also introduce a `crdb_internal.pretty_span` builtin to help with the readability of this table. In future PRs we'll make use of this built-in for datadriven tests asserting on the state of the table. Release note (sql change): We've added a `system.span_configurations` table. This will later be used to store authoritative span configs that KV has decided to apply. Release justification: non-production code changes
- Loading branch information
1 parent
5ba04b9
commit 36c0065
Showing
75 changed files
with
5,110 additions
and
724 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
debug doctor examine cluster | ||
---- | ||
debug doctor examine cluster | ||
Examining 40 descriptors and 41 namespace entries... | ||
Examining 41 descriptors and 42 namespace entries... | ||
ParentID 50, ParentSchemaID 29: relation "foo" (53): expected matching namespace entry, found none | ||
Examining 4 jobs... | ||
ERROR: validation failed |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.