From ea20982e50b47c0386eaf7620d5be1dd9e29905d Mon Sep 17 00:00:00 2001 From: Wenxuan Date: Fri, 15 Mar 2024 15:36:55 +0800 Subject: [PATCH] executor: Fix compact for VARCHAR PK (#51812) fix pingcap/tidb#51810 --- pkg/executor/compact_table.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/executor/compact_table.go b/pkg/executor/compact_table.go index 33b4b19cd4348..ea9f7f43bf36b 100644 --- a/pkg/executor/compact_table.go +++ b/pkg/executor/compact_table.go @@ -15,7 +15,6 @@ package executor import ( - "bytes" "context" "encoding/hex" "time" @@ -317,7 +316,7 @@ func (task *storeCompactTask) compactOnePhysicalTable(physicalTableID int64) (bo // Let's send more compact requests, as there are remaining data to compact. lastEndKey := resp.GetCompactedEndKey() - if len(lastEndKey) == 0 || bytes.Compare(lastEndKey, startKey) <= 0 { + if len(lastEndKey) == 0 { // The TiFlash server returned an invalid compacted end key. // This is unexpected... warn := errors.NewNoStackErrorf("compact on store %s failed: internal error (check logs for details)", task.targetStore.Address)