Skip to content

Commit 01b3fd8

Browse files
committed
pkg/ddl: fix sample region pagination and flaky test
1 parent a187769 commit 01b3fd8

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

pkg/ddl/index.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4105,10 +4105,16 @@ func listSamplePredictionRegions(ctx context.Context, store kv.Storage, physical
41054105
}
41064106
}
41074107
lastKey := regionInfos.Regions[len(regionInfos.Regions)-1].EndKey
4108+
if len(lastKey) == 0 {
4109+
break
4110+
}
41084111
start, err = hex.DecodeString(lastKey)
41094112
if err != nil {
41104113
return nil, err
41114114
}
4115+
if len(start) == 0 {
4116+
break
4117+
}
41124118
if bytes.Compare(start, end) >= 0 {
41134119
break
41144120
}

tests/realtikvtest/addindextest2/global_sort_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,6 @@ func TestDXFAddIndexRealtimeSummary(t *testing.T) {
804804
require.EqualValues(t, taskIDNum, got.taskID)
805805
require.EqualValues(t, readIndexBytes, got.logicalIndexKVBytes)
806806
require.GreaterOrEqual(t, got.observedIncrease, int64(0))
807-
require.GreaterOrEqual(t, got.finalUsedBytes, got.initialUsedBytes)
808807
}
809808

810809
func TestSplitRangeForTable(t *testing.T) {

0 commit comments

Comments
 (0)