Skip to content

Commit

Permalink
This is an automated cherry-pick of #50316
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <[email protected]>
  • Loading branch information
YuJuncen authored and ti-chi-bot committed Apr 12, 2024
1 parent eae093d commit f072d95
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions br/pkg/restore/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@ func doRecoveryData(ctx context.Context, resolveTS uint64, allStores []*metapb.S
return totalRegions, recoveryError{error: err, atStage: StageRecovering}
}

if err := recovery.WaitApply(ctx); err != nil {
return totalRegions, recoveryError{error: err, atStage: StageRecovering}
}

if err := recovery.PrepareFlashbackToVersion(ctx, resolveTS, restoreTS-1); err != nil {
return totalRegions, recoveryError{error: err, atStage: StageFlashback}
}
Expand Down Expand Up @@ -228,7 +224,7 @@ func (recovery *Recovery) ReadRegionMeta(ctx context.Context) error {
totalStores := len(recovery.allStores)
workers := utils.NewWorkerPool(uint(mathutil.Min(totalStores, common.MaxStoreConcurrency)), "Collect Region Meta") // TODO: int overflow?

// TODO: optimize the ErroGroup when TiKV is panic
// TODO: optimize the ErrorGroup when TiKV is panic
metaChan := make(chan StoreMeta, 1024)
defer close(metaChan)

Expand Down Expand Up @@ -399,6 +395,7 @@ func (recovery *Recovery) SpawnTiKVShutDownWatchers(ctx context.Context) {
go mainLoop()
}

<<<<<<< HEAD
// WaitApply send wait apply to all tikv ensure all region peer apply log into the last
func (recovery *Recovery) WaitApply(ctx context.Context) (err error) {
eg, ectx := errgroup.WithContext(ctx)
Expand Down Expand Up @@ -435,6 +432,8 @@ func (recovery *Recovery) WaitApply(ctx context.Context) (err error) {
return eg.Wait()
}

=======
>>>>>>> bf8d4740700 (restore_data: remove wait apply phase (#50316))
// prepare the region for flashback the data, the purpose is to stop region service, put region in flashback state
func (recovery *Recovery) PrepareFlashbackToVersion(ctx context.Context, resolveTS uint64, startTS uint64) (err error) {
retryState := utils.InitialRetryState(utils.FlashbackRetryTime, utils.FlashbackWaitInterval, utils.FlashbackMaxWaitInterval)
Expand Down

0 comments on commit f072d95

Please sign in to comment.