Skip to content

Commit

Permalink
Cache workflow for Reshard as well since same workflow name is used i…
Browse files Browse the repository at this point in the history
…n e2e tests for reshard and movetables

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
  • Loading branch information
rohit-nayak-ps committed Oct 9, 2023
1 parent c1f05ba commit c605f38
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions go/vt/wrangler/resharder.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
"sync"
"time"

"vitess.io/vitess/go/vt/proto/topodata"

"google.golang.org/protobuf/encoding/prototext"

"vitess.io/vitess/go/vt/log"
Expand Down Expand Up @@ -95,6 +97,17 @@ func (wr *Wrangler) Reshard(ctx context.Context, keyspace, workflow string, sour
return vterrors.Wrap(err, "createStreams")
}

wm := &topodata.WorkflowMetadata{
Name: workflow,
Type: "Reshard",
TargetShards: targets,
SourceShards: sources,
}
log.Infof("Going to save workflow metadata for workflow %s: %+v", workflow, wm)
if err := wr.ts.SaveWorkflowMetadata(ctx, keyspace, wm); err != nil {
return err
}

if autoStart {
if err := rs.startStreams(ctx); err != nil {
return vterrors.Wrap(err, "startStreams")
Expand Down

0 comments on commit c605f38

Please sign in to comment.