зеркало из https://github.com/github/vitess-gh.git
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:
Родитель
ce89f736be
Коммит
de1ca3dc6e
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче