Skip to content

Commit

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

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

Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: JmPotato <ghzpotato@gmail.com>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Co-authored-by: Ryan Leung <rleungx@gmail.com>
  • Loading branch information
4 people authored Sep 14, 2024
1 parent d12786c commit 67c89a2
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 @@ -1310,6 +1310,7 @@ func (kgm *KeyspaceGroupManager) mergingChecker(ctx context.Context, mergeTarget
mergeMap[id] = struct{}{}
}

mergeLoop:
for {
select {
case <-ctx.Done():
Expand Down Expand Up @@ -1381,15 +1382,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 67c89a2

Please sign in to comment.