From f3dd0b62857ba0da97842349808aa4d4d4eefb34 Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Wed, 14 Aug 2024 13:43:37 +0800 Subject: [PATCH] tso: fix an invalid err != nil check (#8523) (#8525) close tikv/pd#8524 Use the continue label to retry the whole merge loop correctly. Signed-off-by: JmPotato Co-authored-by: JmPotato --- pkg/tso/keyspace_group_manager.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/tso/keyspace_group_manager.go b/pkg/tso/keyspace_group_manager.go index 79521e90e8f..5a2c908ec2e 100644 --- a/pkg/tso/keyspace_group_manager.go +++ b/pkg/tso/keyspace_group_manager.go @@ -1302,6 +1302,7 @@ func (kgm *KeyspaceGroupManager) mergingChecker(ctx context.Context, mergeTarget mergeMap[id] = struct{}{} } +mergeLoop: for { select { case <-ctx.Done(): @@ -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",