-
Notifications
You must be signed in to change notification settings - Fork 9
[vtctld] Custom build for vtctld development #195
base: slack-vitess-8-2021.03.03r0.wip
Are you sure you want to change the base?
[vtctld] Custom build for vtctld development #195
Conversation
Initial implementation of vtctld service
Signed-off-by: Andrew Mason <[email protected]>
…_keyspace Add FindAllShardsInKeyspace to vtctldserver
…ator [vtctldclient] vtctldclient generator
…nkeyspace [vtctld] Fix accidentally-broken legacy vtctl output format
[vtctld] Migrate cell getters
[vtctld] migrate tablet getters
…nd_pkg [vtctld] vtctldclient command pkg
[vtctld] Add GetSrvVSchema command
[vtctld] Migrate GetSchema Signed-off-by: Richard Bailey <[email protected]>
[vtctld] Migrate ListBackups as GetBackups in new vtctld server
[vtctld] Migrate GetVSchema to VtctldServer
[vtctld] Migrate topo management RPCs Signed-off-by: Richard Bailey <[email protected]>
…ce_errors [vtctldclient] Set `SilenceErrors` on the root command, so we don't double-log
Provide named function for squashing usage errors; start using it
Signed-off-by: Andrew Mason <[email protected]>
[vtctld | tests only] testtmclient refactor Conflicts: go/vt/vtadmin/api_test.go go/vt/vtctl/reparentutil/emergency_reparenter_test.go go/vt/vtctl/reparentutil/planned_reparenter_test.go Resolved by `git rm -f` those files. Note: Also includes a change to grpcvtctldclient/client_test.go, not in the cherry-picked commit, to use the testutil constructor for vtctldservers. Signed-off-by: Andrew Mason <[email protected]> wip test fixes Signed-off-by: Andrew Mason <[email protected]> Signed-off-by: Richard Bailey <[email protected]>
[vtctld] Add v0 GetWorkflows rpc and workflow/vexec packages Signed-off-by: Andrew Mason <[email protected]> Conflicts: go/vt/proto/vtctldata/vtctldata.pb.go go/vt/proto/vtctlservice/vtctlservice.pb.go go/vt/vtctl/grpcvtctldclient/client_gen.go go/vt/vtctl/grpcvtctldserver/server.go go/vt/wrangler/vexec.go proto/vtctldata.proto proto/vtctlservice.proto
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Richard Bailey <[email protected]>
33ffe0b
to
1f6f322
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good to me!
|
||
package main | ||
|
||
// Imports and register the gRPC vtctld client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh i will fix this wording upstream
@@ -1383,9 +1383,6 @@ func (m *VEvent) GetJournal() *Journal { | |||
|
|||
func (m *VEvent) GetDml() string { | |||
if m != nil { | |||
if m.Statement != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just calling out this diff because github hides it; a long time ago someone manually edited this proto file to include this check, which running make proto
removes. Upstream was fine with this change.
@@ -1773,20 +1760,29 @@ func commandGetKeyspace(ctx context.Context, wr *wrangler.Wrangler, subFlags *fl | |||
} | |||
|
|||
keyspace := subFlags.Arg(0) | |||
keyspaceInfo, err := wr.TopoServer().GetKeyspace(ctx, keyspace) | |||
|
|||
keyspaceInfo, err := wr.VtctldServer().GetKeyspace(ctx, &vtctldatapb.GetKeyspaceRequest{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calling this out as a code change in the legacy server, which is backwards compatible, but technically a change
} | ||
|
||
func commandGetKeyspaces(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) error { | ||
keyspaces, err := wr.TopoServer().GetKeyspaces(ctx) | ||
resp, err := wr.VtctldServer().GetKeyspaces(ctx, &vtctldatapb.GetKeyspacesRequest{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calling this out as a code change in the legacy server, which is backwards compatible, but technically a change
@@ -2224,11 +2220,21 @@ func commandFindAllShardsInKeyspace(ctx context.Context, wr *wrangler.Wrangler, | |||
} | |||
|
|||
keyspace := subFlags.Arg(0) | |||
result, err := wr.TopoServer().FindAllShardsInKeyspace(ctx, keyspace) | |||
result, err := wr.VtctldServer().FindAllShardsInKeyspace(ctx, &vtctldatapb.FindAllShardsInKeyspaceRequest{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calling this out as a code change in the legacy server, which is backwards compatible, but technically a change
@@ -2311,17 +2317,25 @@ func commandGetSchema(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag | |||
excludeTableArray = strings.Split(*excludeTables, ",") | |||
} | |||
|
|||
sd, err := wr.GetSchema(ctx, tabletAlias, tableArray, excludeTableArray, *includeViews) | |||
resp, err := wr.VtctldServer().GetSchema(ctx, &vtctldatapb.GetSchemaRequest{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calling this out as a code change in the legacy server, which is backwards compatible, but technically a change
@@ -28,3 +28,70 @@ import "vtctldata.proto"; | |||
service Vtctl { | |||
rpc ExecuteVtctlCommand (vtctldata.ExecuteVtctlCommandRequest) returns (stream vtctldata.ExecuteVtctlCommandResponse) {}; | |||
} | |||
|
|||
// Service Vtctld exposes gRPC endpoints for each vt command. | |||
service Vtctld { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirming this has everything needed by vtadmin
* Merge pull request #187 from tinyspeck/backport-am_get_schema_sizes_only Add option to GetSchema to only send the row count and data length over the wire * whitespace! * derp, actually commit rm dead import Signed-off-by: Richard Bailey <[email protected]> Co-authored-by: Andrew Mason <[email protected]>
Branch construction -- cherry-pick results (
x
- merged fine,c
- conflict)