Skip to content

Commit

Permalink
Finish vdiff show
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Sep 18, 2023
1 parent fe1f296 commit f1e4f26
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions go/vt/vtctl/workflow/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ import (

binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata"
querypb "vitess.io/vitess/go/vt/proto/query"
"vitess.io/vitess/go/vt/proto/tabletmanagerdata"
tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata"
topodatapb "vitess.io/vitess/go/vt/proto/topodata"
vschemapb "vitess.io/vitess/go/vt/proto/vschema"
Expand Down Expand Up @@ -94,7 +93,7 @@ type sequenceMetadata struct {

type VDiffOutput struct {
mu sync.Mutex
responses map[string]*tabletmanagerdata.VDiffResponse
responses map[string]*tabletmanagerdatapb.VDiffResponse
err error
}

Expand Down Expand Up @@ -1341,7 +1340,7 @@ func (s *Server) VDiffCreate(ctx context.Context, req *vtctldatapb.VDiffCreateRe
},
}

tabletreq := &tabletmanagerdata.VDiffRequest{
tabletreq := &tabletmanagerdatapb.VDiffRequest{
Keyspace: req.TargetKeyspace,
Workflow: req.Workflow,
Action: string(vdiff.CreateAction),
Expand Down Expand Up @@ -1377,17 +1376,11 @@ func (s *Server) VDiffShow(ctx context.Context, req *vtctldatapb.VDiffShowReques
span, ctx := trace.NewSpan(ctx, "workflow.Server.VDiffShow")
defer span.Finish()

defer func() {
if r := recover(); r != nil {
log.Errorf("PANIC: %v", r)
}
}()

span.Annotate("keyspace", req.TargetKeyspace)
span.Annotate("workflow", req.Workflow)
span.Annotate("argument", req.Arg)

tabletreq := &tabletmanagerdata.VDiffRequest{
tabletreq := &tabletmanagerdatapb.VDiffRequest{
Keyspace: req.TargetKeyspace,
Workflow: req.Workflow,
Action: string(vdiff.ShowAction),
Expand All @@ -1399,7 +1392,10 @@ func (s *Server) VDiffShow(ctx context.Context, req *vtctldatapb.VDiffShowReques
return nil, err
}

output := &VDiffOutput{}
output := &VDiffOutput{
responses: make(map[string]*tabletmanagerdatapb.VDiffResponse, len(ts.targets)),
err: nil,
}
output.err = ts.ForAllTargets(func(target *MigrationTarget) error {
resp, err := s.tmc.VDiff(ctx, target.GetPrimary().Tablet, tabletreq)
output.mu.Lock()
Expand Down

0 comments on commit f1e4f26

Please sign in to comment.