Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
fix switch mode bug in restore (#473)
Browse files Browse the repository at this point in the history
  • Loading branch information
3pointer authored Aug 26, 2020
1 parent 64271cf commit 3234e8d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/restore/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,14 @@ func (rc *Client) SwitchToImportMode(ctx context.Context) {
// so we need ping tikv in less than 10 minute
go func() {
tick := time.NewTicker(rc.switchModeInterval)
defer tick.Stop()

// [important!] switch tikv mode into import at the beginning
log.Info("switch to import mode at beginning")
err := rc.switchTiKVMode(ctx, import_sstpb.SwitchMode_Import)
if err != nil {
log.Warn("switch to import mode failed", zap.Error(err))
}

for {
select {
Expand Down

0 comments on commit 3234e8d

Please sign in to comment.