Skip to content

Commit

Permalink
kvserver: add proxySender variable to node
Browse files Browse the repository at this point in the history
The node object has an indirect reference to DistSender through the
`storeCfg.DB`. This PR directly injects the proxySender variable for use
for proxying requests.

Epic: none

Release note: None
  • Loading branch information
andrewbaptist committed Mar 7, 2024
1 parent c4425c8 commit 199586f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/server/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ type Node struct {
encodedVersion string
updateCh chan struct{}
}
proxySender kv.Sender
}

var _ kvpb.InternalServer = &Node{}
Expand Down Expand Up @@ -565,6 +566,7 @@ func NewNode(
tenantInfoWatcher *tenantcapabilitieswatcher.Watcher,
spanConfigAccessor spanconfig.KVAccessor,
spanConfigReporter spanconfig.Reporter,
proxySender kv.Sender,
) *Node {
n := &Node{
storeCfg: cfg,
Expand All @@ -582,6 +584,7 @@ func NewNode(
spanConfigReporter: spanConfigReporter,
testingErrorEvent: cfg.TestingKnobs.TestingResponseErrorEvent,
spanStatsCollector: spanstatscollector.New(cfg.Settings),
proxySender: proxySender,
}
n.versionUpdateMu.updateCh = make(chan struct{})
n.perReplicaServer = kvserver.MakeServer(&n.Descriptor, n.stores)
Expand Down
1 change: 1 addition & 0 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ func NewServer(cfg Config, stopper *stop.Stopper) (serverctl.ServerStartupInterf
tenantCapabilitiesWatcher,
spanConfig.kvAccessor,
spanConfig.reporter,
distSender,
)
kvpb.RegisterInternalServer(grpcServer.Server, node)
kvserver.RegisterPerReplicaServer(grpcServer.Server, node.perReplicaServer)
Expand Down

0 comments on commit 199586f

Please sign in to comment.