-
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.
rpc,kvclient: cull the internalClientAdapter
rpc.internalClientAdapter is used to call into the roachpb.Internal gRPC service of the local Node without actually going through gRPC. This structure was implementing all of the ever-growing Internal interface, even though it was only ever used for exactly two methods - the ones used by the DistSender (Batch and RangeFeed). This patch extracts the sub-interface of Internal needed by the DistSender, and trims the internalClientAdapter to only implement the respective two methods. There are multiple benefits in doing this trimming: 1) The internalClientAdapter had too much dead code. In particular for streaming methods, the implementation is non-trivial. The respective code is mostly copy-paste, but still. 2) The code in the internalClientAdapter, as written, was insufficient(*) as it was not setting a magic auth key on the ctx required in order to pass the Authentication gRPC server interceptor. In the case of the two methods used by the DistSender, our nodedialer.Dialer does an awkward thing where it create a ctx with the magic key and returns that ctx over several levels to the grpcTransport, which use it for the upcoming gRPC call. This patch removes this awkward protocol by having the internalClientAdaptor populate the auth key in the ctx. (*) Full disclosure - the respective magic key is not actually needed since we don't currently run the gRPC interceptors for these local RPCs. But I'm trying to change that. Release note: None
- Loading branch information
1 parent
ba4d29e
commit 0dade40
Showing
10 changed files
with
84 additions
and
195 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.