@@ -401,7 +401,7 @@ func (c *twoPhaseCommitter) buildPipelinedResolveHandler(commit bool, resolved *
401
401
// Use time-based callback control
402
402
lastCallback := atomic.Value {}
403
403
lastCallback .Store (time .Now ().Add (- minProgressUpdateInterval ))
404
-
404
+
405
405
return func (ctx context.Context , r kv.KeyRange ) (rangetask.TaskStat , error ) {
406
406
start := r .StartKey
407
407
res := rangetask.TaskStat {}
@@ -450,7 +450,7 @@ func (c *twoPhaseCommitter) buildPipelinedResolveHandler(commit bool, resolved *
450
450
}
451
451
resolved .Add (1 )
452
452
res .CompletedRegions ++
453
-
453
+
454
454
// Update progress periodically
455
455
if c .txn .pipelinedProgressCallback != nil {
456
456
now := time .Now ()
@@ -459,8 +459,8 @@ func (c *twoPhaseCommitter) buildPipelinedResolveHandler(commit bool, resolved *
459
459
if timeSinceLastCallback < 0 {
460
460
timeSinceLastCallback = minProgressUpdateInterval
461
461
}
462
- if timeSinceLastCallback >= minProgressUpdateInterval &&
463
- lastCallback .CompareAndSwap (last , now ) {
462
+ if timeSinceLastCallback >= minProgressUpdateInterval &&
463
+ lastCallback .CompareAndSwap (last , now ) {
464
464
resolvedCount := int64 (resolved .Load ())
465
465
c .txn .pipelinedProgressCallback (
466
466
c .startTS ,
@@ -470,7 +470,7 @@ func (c *twoPhaseCommitter) buildPipelinedResolveHandler(commit bool, resolved *
470
470
)
471
471
}
472
472
}
473
-
473
+
474
474
done := loc .EndKey == nil || bytes .Compare (loc .EndKey , r .EndKey ) >= 0
475
475
if done {
476
476
return res , nil
@@ -544,7 +544,7 @@ func (c *twoPhaseCommitter) resolveFlushedLocks(bo *retry.Backoffer, start, end
544
544
true ,
545
545
)
546
546
}
547
-
547
+
548
548
// wait a while before notifying txn_status_cache to evict the txn,
549
549
// which tolerates slow followers and avoids the situation that the
550
550
// txn is evicted before the follower catches up.
0 commit comments