making sure fresh state works before turning off query service during a split

Signed-off-by: Yufei Chen <yufei@squareup.com>
This commit is contained in:
Yufei Chen 2019-09-06 16:17:54 +10:00
Родитель ce89f736be
Коммит de1ca3dc6e
1 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -641,11 +641,22 @@ func (wr *Wrangler) masterMigrateServedType(ctx context.Context, keyspace string
}()
// Phase 1
// - check topology service can successfully refresh both source and target master
// - switch the source shards to read-only by disabling query service
// - gather all replication points
// - wait for filtered replication to catch up
// - mark source shards as frozen
event.DispatchUpdate(ev, "disabling query service on all source masters")
// making sure the refreshMaster on both source and target are working before turning off query service on source
if err := wr.refreshMasters(ctx, sourceShards); err != nil {
wr.cancelMasterMigrateServedTypes(ctx, keyspace, sourceShards)
return err
}
if err := wr.refreshMasters(ctx, destinationShards); err != nil {
wr.cancelMasterMigrateServedTypes(ctx, keyspace, sourceShards)
return err
}
if err := wr.updateShardRecords(ctx, keyspace, sourceShards, nil, topodatapb.TabletType_MASTER, true, false); err != nil {
wr.cancelMasterMigrateServedTypes(ctx, keyspace, sourceShards)
return err