@@ -13,7 +13,6 @@ import (
1313 "sort"
1414 "time"
1515
16- "github.com/cockroachdb/cockroach/pkg/config"
1716 "github.com/cockroachdb/cockroach/pkg/config/zonepb"
1817 "github.com/cockroachdb/cockroach/pkg/gossip"
1918 "github.com/cockroachdb/cockroach/pkg/keys"
@@ -128,12 +127,6 @@ type Connector interface {
128127 // OverridesMonitor provides access to tenant cluster setting overrides.
129128 settingswatcher.OverridesMonitor
130129
131- // SystemConfigProvider provides access to basic host-tenant controlled
132- // information regarding tenant zone configs. This is critical for the
133- // mixed version 21.2->22.1 state where the tenant has not yet configured
134- // its own zones.
135- config.SystemConfigProvider
136-
137130 // GetClusterInitGracePeriodTS will return the timestamp used to signal the
138131 // end of the grace period for clusters with a license. The timestamp is
139132 // represented as the number of seconds since the Unix epoch.
@@ -181,11 +174,9 @@ type connector struct {
181174
182175 mu struct {
183176 syncutil.RWMutex
184- client * client
185- nodeDescs map [roachpb.NodeID ]* roachpb.NodeDescriptor
186- storeDescs map [roachpb.StoreID ]* roachpb.StoreDescriptor
187- systemConfig * config.SystemConfig
188- systemConfigChannels map [chan <- struct {}]struct {}
177+ client * client
178+ nodeDescs map [roachpb.NodeID ]* roachpb.NodeDescriptor
179+ storeDescs map [roachpb.StoreID ]* roachpb.StoreDescriptor
189180 }
190181
191182 settingsMu struct {
@@ -249,12 +240,6 @@ var _ kvclient.NodeDescStore = (*connector)(nil)
249240// requested owned by the requesting tenant?).
250241var _ rangecache.RangeDescriptorDB = (* connector )(nil )
251242
252- // connector is capable of providing a filtered view of the SystemConfig
253- // containing only information applicable to secondary tenants. This obviates
254- // the need for SQL-only tenant servers to join the cluster-wide gossip
255- // network.
256- var _ config.SystemConfigProvider = (* connector )(nil )
257-
258243// connector is capable of finding debug information about the current
259244// tenant within the cluster. This is necessary for things such as
260245// debug zip and range reports.
@@ -295,7 +280,6 @@ func NewConnector(cfg ConnectorConfig, addrs []string) Connector {
295280
296281 c .mu .nodeDescs = make (map [roachpb.NodeID ]* roachpb.NodeDescriptor )
297282 c .mu .storeDescs = make (map [roachpb.StoreID ]* roachpb.StoreDescriptor )
298- c .mu .systemConfigChannels = make (map [chan <- struct {}]struct {})
299283 c .settingsMu .allTenantOverrides = make (map [settings.InternalKey ]settings.EncodedValue )
300284 c .settingsMu .specificOverrides = make (map [settings.InternalKey ]settings.EncodedValue )
301285 c .settingsMu .notifyCh = make (chan struct {})
@@ -454,8 +438,6 @@ var gossipSubsHandlers = map[string]func(*connector, context.Context, string, ro
454438 gossip .MakePrefixPattern (gossip .KeyNodeDescPrefix ): (* connector ).updateNodeAddress ,
455439 // Subscribe to all *StoreDescriptor updates.
456440 gossip .MakePrefixPattern (gossip .KeyStoreDescPrefix ): (* connector ).updateStoreMap ,
457- // Subscribe to a filtered view of *SystemConfig updates.
458- gossip .KeyDeprecatedSystemConfig : (* connector ).updateSystemConfig ,
459441}
460442
461443var gossipSubsPatterns = func () []string {
@@ -548,59 +530,6 @@ func (c *connector) GetStoreDescriptor(storeID roachpb.StoreID) (*roachpb.StoreD
548530 return desc , nil
549531}
550532
551- // updateSystemConfig handles updates to a filtered view of the "system-db"
552- // gossip key, performing the corresponding update to the connector's cached
553- // SystemConfig.
554- func (c * connector ) updateSystemConfig (ctx context.Context , key string , content roachpb.Value ) {
555- cfg := config .NewSystemConfig (c .defaultZoneCfg )
556- if err := content .GetProto (& cfg .SystemConfigEntries ); err != nil {
557- log .Errorf (ctx , "could not unmarshal system config: %v" , err )
558- return
559- }
560-
561- c .mu .Lock ()
562- defer c .mu .Unlock ()
563- c .mu .systemConfig = cfg
564- for c := range c .mu .systemConfigChannels {
565- select {
566- case c <- struct {}{}:
567- default :
568- }
569- }
570- }
571-
572- // GetSystemConfig implements the config.SystemConfigProvider interface.
573- func (c * connector ) GetSystemConfig () * config.SystemConfig {
574- // TODO(nvanbenschoten): we need to wait in `(*connector).Start()` until the
575- // system config is populated. As is, there's a small chance that we return
576- // nil, which SQL does not handle.
577- c .mu .RLock ()
578- defer c .mu .RUnlock ()
579- return c .mu .systemConfig
580- }
581-
582- // RegisterSystemConfigChannel implements the config.SystemConfigProvider
583- // interface.
584- func (c * connector ) RegisterSystemConfigChannel () (_ <- chan struct {}, unregister func ()) {
585- // Create channel that receives new system config notifications. The channel
586- // has a size of 1 to prevent connector from having to block on it.
587- ch := make (chan struct {}, 1 )
588-
589- c .mu .Lock ()
590- defer c .mu .Unlock ()
591- c .mu .systemConfigChannels [ch ] = struct {}{}
592-
593- // Notify the channel right away if we have a config.
594- if c .mu .systemConfig != nil {
595- ch <- struct {}{}
596- }
597- return ch , func () {
598- c .mu .Lock ()
599- defer c .mu .Unlock ()
600- delete (c .mu .systemConfigChannels , ch )
601- }
602- }
603-
604533// RangeLookup implements the kvcoord.RangeDescriptorDB interface.
605534func (c * connector ) RangeLookup (
606535 ctx context.Context , key roachpb.RKey , rc rangecache.RangeLookupConsistency , useReverseScan bool ,
@@ -1111,16 +1040,6 @@ func AddressResolver(s kvclient.NodeDescStore) nodedialer.AddressResolver {
11111040 }
11121041}
11131042
1114- // GossipSubscriptionSystemConfigMask filters a system config down to just the
1115- // keys that a tenant SQL servers needs access to. All system tenant objects are
1116- // filtered out (e.g. system tenant descriptors and users).
1117- var GossipSubscriptionSystemConfigMask = config .MakeSystemConfigMask (
1118- // Tenant SQL servers need just enough of the zone hierarchy to understand
1119- // which zone configurations apply to their keyspace.
1120- config .MakeZoneKey (keys .SystemSQLCodec , keys .RootNamespaceID ),
1121- config .MakeZoneKey (keys .SystemSQLCodec , keys .TenantsRangesID ),
1122- )
1123-
11241043// CombineKVAddresses combines the remote and loopback addresses into a single
11251044// slice, while aldo de-duplicating the loopback address if it's present in the
11261045// remote addresses.
0 commit comments