diff --git a/go/vt/vtctl/vtctl.go b/go/vt/vtctl/vtctl.go index 70dee6b0116..9e98edc59fe 100644 --- a/go/vt/vtctl/vtctl.go +++ b/go/vt/vtctl/vtctl.go @@ -3108,11 +3108,12 @@ func commandGetVSchema(ctx context.Context, wr *wrangler.Wrangler, subFlags *fla } func commandGetRoutingRules(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) error { - rr, err := wr.TopoServer().GetRoutingRules(ctx) + resp, err := wr.VtctldServer().GetRoutingRules(ctx, &vtctldatapb.GetRoutingRulesRequest{}) if err != nil { return err } - b, err := json2.MarshalIndentPB(rr, " ") + + b, err := json2.MarshalIndentPB(resp.RoutingRules, " ") if err != nil { wr.Logger().Printf("%v\n", err) return err @@ -3132,7 +3133,10 @@ func commandRebuildVSchemaGraph(ctx context.Context, wr *wrangler.Wrangler, subF return fmt.Errorf("RebuildVSchemaGraph doesn't take any arguments") } - return wr.TopoServer().RebuildSrvVSchema(ctx, cells) + _, err := wr.VtctldServer().RebuildVSchemaGraph(ctx, &vtctldatapb.RebuildVSchemaGraphRequest{ + Cells: cells, + }) + return err } func commandApplyVSchema(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) error { @@ -3286,15 +3290,12 @@ func commandApplyRoutingRules(ctx context.Context, wr *wrangler.Wrangler, subFla wr.Logger().Printf("New RoutingRules object:\n%s\nIf this is not what you expected, check the input data (as JSON parsing will skip unexpected fields).\n", b) } - if err := wr.TopoServer().SaveRoutingRules(ctx, rr); err != nil { - return err - } - - if *skipRebuild { - wr.Logger().Warningf("Skipping rebuild of SrvVSchema, will need to run RebuildVSchemaGraph for changes to take effect") - return nil - } - return wr.TopoServer().RebuildSrvVSchema(ctx, cells) + _, err = wr.VtctldServer().ApplyRoutingRules(ctx, &vtctldatapb.ApplyRoutingRulesRequest{ + RoutingRules: rr, + SkipRebuild: *skipRebuild, + RebuildCells: cells, + }) + return err } func commandGetSrvKeyspaceNames(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) error {