Commit 25747e5
committed
rpc: remove GRPCDial() and disallow anonymous non-gossip connections
The previous patch introduced node ID verification for GRPC
connections but preserved the `GRPCDial()` API, alongside
the ability to use node ID 0 with `GRPCDialNode()`, to signal
that node ID verification should be disabled.
Further examination revealed that this flexibility is 1) hard to
reason about and 2) unneeded.
So instead of keeping this option and then investing time into
producing tests for all the combinations of verifications protocols,
this patch "cuts the gordian knot" by removing this flexibility
altogether.
In summary:
- `GRPCDial()` is removed.
- `GRPCDialNode()` will call log.Fatal() if provided a 0 node ID.
- `GRPCGossipDial()` is introduced, with a clarification
about its contract. I have audited the code to validate that
this is indeed only used by gossip, and the CLI client commands
that really don't care about the node ID.
Release note: None1 parent 68ba844 commit 25747e5
File tree
17 files changed
+150
-80
lines changed- pkg
- cli
- gossip
- kv
- rpc
- nodedialer
- server
- sql/distsqlrun
- testutils/testcluster
- ts
17 files changed
+150
-80
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
256 | 259 | | |
257 | 260 | | |
258 | 261 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1132 | 1132 | | |
1133 | 1133 | | |
1134 | 1134 | | |
1135 | | - | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
1136 | 1138 | | |
1137 | 1139 | | |
1138 | 1140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | | - | |
| 464 | + | |
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
69 | 75 | | |
70 | 76 | | |
71 | 77 | | |
| |||
136 | 142 | | |
137 | 143 | | |
138 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
139 | 149 | | |
140 | 150 | | |
141 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
462 | | - | |
463 | | - | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
464 | 466 | | |
465 | 467 | | |
466 | 468 | | |
| |||
695 | 697 | | |
696 | 698 | | |
697 | 699 | | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
706 | 706 | | |
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
710 | | - | |
711 | | - | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
712 | 714 | | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
713 | 722 | | |
714 | 723 | | |
715 | 724 | | |
| |||
765 | 774 | | |
766 | 775 | | |
767 | 776 | | |
768 | | - | |
| 777 | + | |
769 | 778 | | |
770 | 779 | | |
771 | 780 | | |
| |||
776 | 785 | | |
777 | 786 | | |
778 | 787 | | |
779 | | - | |
780 | | - | |
781 | | - | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
782 | 793 | | |
783 | 794 | | |
784 | 795 | | |
785 | | - | |
| 796 | + | |
786 | 797 | | |
787 | 798 | | |
788 | 799 | | |
| |||
0 commit comments