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

Commit 10697d0

Browse files
ti-srebot3pointer
andauthored
fix switch mode bug in restore (#474)
Co-authored-by: luancheng <luancheng@pingcap.com>
1 parent 956efe7 commit 10697d0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

pkg/restore/client.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,14 @@ func (rc *Client) SwitchToImportMode(ctx context.Context) {
718718
// so we need ping tikv in less than 10 minute
719719
go func() {
720720
tick := time.NewTicker(rc.switchModeInterval)
721+
defer tick.Stop()
722+
723+
// [important!] switch tikv mode into import at the beginning
724+
log.Info("switch to import mode at beginning")
725+
err := rc.switchTiKVMode(ctx, import_sstpb.SwitchMode_Import)
726+
if err != nil {
727+
log.Warn("switch to import mode failed", zap.Error(err))
728+
}
721729

722730
for {
723731
select {

0 commit comments

Comments
 (0)