Skip to content

Commit 4eb55fb

Browse files
committed
kv: extract TenantSpanConfig and register with DRPC server
This is a follow-up to #145195, where we extracted `KVBatch` from the `Internal` service. Here, we do the same with `TenantSpanConfig`. The TL;DR is that smaller services are easier to maintain and can be more smoothly migrated to DRPC. We also enable this service on the DRPC server. This is controlled by `rpc.experimental_drpc.enabled` (off by default). This change is part of a series and is similar to: #146926 Note: This only registers the service; the client is not updated to use the DRPC client, so this service will not have any functional effect. Epic: CRDB-48925 Release note: None
1 parent 3ff7b49 commit 4eb55fb

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

pkg/kv/kvpb/api.proto

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3692,6 +3692,26 @@ service TenantUsage {
36923692
rpc TokenBucket (TokenBucketRequest) returns (TokenBucketResponse) {}
36933693
}
36943694

3695+
// TenantSpanConfig provides RPCs for secondary tenants to operate on span
3696+
// configs, such as reading and updating them.
3697+
service TenantSpanConfig {
3698+
// GetSpanConfigs is used to fetch the span configurations over a given
3699+
// keyspan.
3700+
rpc GetSpanConfigs(GetSpanConfigsRequest) returns (GetSpanConfigsResponse) {}
3701+
3702+
// GetAllSystemSpanConfigsThatApply is used to fetch all system span
3703+
// configurations that apply over a tenant's ranges.
3704+
rpc GetAllSystemSpanConfigsThatApply(GetAllSystemSpanConfigsThatApplyRequest) returns (GetAllSystemSpanConfigsThatApplyResponse) {}
3705+
3706+
// UpdateSpanConfigs is used to update the span configurations over given
3707+
// keyspans.
3708+
rpc UpdateSpanConfigs(UpdateSpanConfigsRequest) returns (UpdateSpanConfigsResponse) {}
3709+
3710+
// SpanConfigConformance is used to determine whether ranges backing the given
3711+
// keyspans conform to span configs that apply over them.
3712+
rpc SpanConfigConformance(SpanConfigConformanceRequest) returns (SpanConfigConformanceResponse) {}
3713+
}
3714+
36953715
// Batch and RangeFeed service implemented by nodes for KV API requests.
36963716
service Internal {
36973717
rpc Batch (BatchRequest) returns (BatchResponse) {}

pkg/server/server.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,9 @@ func NewServer(cfg Config, stopper *stop.Stopper) (serverctl.ServerStartupInterf
992992
if err := kvpb.DRPCRegisterTenantUsage(drpcServer, node); err != nil {
993993
return nil, err
994994
}
995+
if err := kvpb.DRPCRegisterTenantSpanConfig(drpcServer, node); err != nil {
996+
return nil, err
997+
}
995998
kvserver.RegisterPerReplicaServer(grpcServer.Server, node.perReplicaServer)
996999
if err := kvserver.DRPCRegisterPerReplica(drpcServer, node.perReplicaServer); err != nil {
9971000
return nil, err

0 commit comments

Comments
 (0)