Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions go/vt/wrangler/migrater.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,13 @@ func (mi *migrater) gatherPositions(ctx context.Context) error {
}

func (mi *migrater) createJournals(ctx context.Context) error {
var participants []*binlogdatapb.KeyspaceShard
for sourceShard := range mi.sources {
participants = append(participants, &binlogdatapb.KeyspaceShard{
Keyspace: mi.sourceKeyspace,
Shard: sourceShard,
})
}
return mi.forAllSources(func(source *miSource) error {
if source.journaled {
return nil
Expand All @@ -579,8 +586,8 @@ func (mi *migrater) createJournals(ctx context.Context) error {
MigrationType: mi.migrationType,
Tables: mi.tables,
LocalPosition: source.position,
Participants: participants,
}
participantMap := make(map[string]bool)
for targetShard, target := range mi.targets {
found := false
for _, tsource := range target.sources {
Expand All @@ -597,15 +604,6 @@ func (mi *migrater) createJournals(ctx context.Context) error {
Shard: targetShard,
Gtid: target.position,
})
for _, tsource := range target.sources {
participantMap[tsource.Shard] = true
}
}
for shard := range participantMap {
journal.Participants = append(journal.Participants, &binlogdatapb.KeyspaceShard{
Keyspace: mi.sourceKeyspace,
Shard: shard,
})
}
mi.wr.Logger().Infof("Creating journal: %v", journal)
statement := fmt.Sprintf("insert into _vt.resharding_journal "+
Expand Down