From eeb03a0d6a32b70175bc16ef8b016e376c1aad44 Mon Sep 17 00:00:00 2001 From: wei liu Date: Tue, 9 Jul 2024 10:46:11 +0800 Subject: [PATCH] fix: Query may return deleted records (#34501) issue: #34500 cause the sort in `GetLevel0Deletions` will broken the corresponed order between pks and tss, then the pks and tss will be sorted in segment.Delete() interface. This PR remove this uncessary and incorrect sort progress to avoid query may return deleted records. Signed-off-by: Wei Liu --- internal/querynodev2/delegator/delegator_data.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/internal/querynodev2/delegator/delegator_data.go b/internal/querynodev2/delegator/delegator_data.go index 4fd2bc1c39d0d..c50620fc163ef 100644 --- a/internal/querynodev2/delegator/delegator_data.go +++ b/internal/querynodev2/delegator/delegator_data.go @@ -21,7 +21,6 @@ import ( "fmt" "math/rand" "runtime" - "sort" "time" "github.com/cockroachdb/errors" @@ -593,10 +592,6 @@ func (sd *shardDelegator) GetLevel0Deletions(partitionID int64, candidate pkorac } } - sort.Slice(pks, func(i, j int) bool { - return tss[i] < tss[j] - }) - return pks, tss }