Skip to content

Commit

Permalink
tso: fix an invalid err != nil check (tikv#8523)
Browse files Browse the repository at this point in the history
close tikv#8524

Use the continue label to retry the whole merge loop correctly.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
  • Loading branch information
JmPotato committed Aug 14, 2024
1 parent ac9ea37 commit 330139e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/tso/keyspace_group_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1304,6 +1304,7 @@ func (kgm *KeyspaceGroupManager) mergingChecker(ctx context.Context, mergeTarget
mergeMap[id] = struct{}{}
}

mergeLoop:
for {
select {
case <-ctx.Done():
Expand Down Expand Up @@ -1375,15 +1376,13 @@ func (kgm *KeyspaceGroupManager) mergingChecker(ctx context.Context, mergeTarget
zap.Uint32("merge-id", id),
zap.Time("ts", ts),
zap.Error(err))
break
// Retry from the beginning of the loop.
continue mergeLoop
}
if ts.After(mergedTS) {
mergedTS = ts
}
}
if err != nil {
continue
}
// Update the newly merged TSO if the merged TSO is not zero.
if mergedTS != typeutil.ZeroTime {
log.Info("start to set the newly merged TSO",
Expand Down

0 comments on commit 330139e

Please sign in to comment.