Skip to content

Commit cf7ae4c

Browse files
authored
statistics: kill in time when to mergeGlobalTopN with partition (#45707)
close #45706
1 parent c46da07 commit cf7ae4c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

statistics/cmsketch.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,9 @@ func MergePartTopN2GlobalTopN(loc *time.Location, version int, topNs []*TopN, n
834834
// 1. Check the topN first.
835835
// 2. If the topN doesn't contain the value corresponding to encodedVal. We should check the histogram.
836836
for j := 0; j < partNum; j++ {
837+
if atomic.LoadUint32(kiiled) == 1 {
838+
return nil, nil, nil, errors.Trace(ErrQueryInterrupted)
839+
}
837840
if (j == i && version >= 2) || topNs[j].findTopN(val.Encoded) != -1 {
838841
continue
839842
}

0 commit comments

Comments
 (0)