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 <[email protected]>
  • Loading branch information
JmPotato authored Aug 14, 2024
1 parent 3b37572 commit 3117f99
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 @@ -1302,6 +1302,7 @@ func (kgm *KeyspaceGroupManager) mergingChecker(ctx context.Context, mergeTarget
mergeMap[id] = struct{}{}
}

mergeLoop:
for {
select {
case <-ctx.Done():
Expand Down Expand Up @@ -1373,15 +1374,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 3117f99

Please sign in to comment.