From 4285ad30aeef7d1c6b522593053d989db117d1b3 Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Thu, 14 Nov 2024 19:15:20 +0800 Subject: [PATCH] update dependencies Signed-off-by: Weizhen Wang --- br/pkg/lightning/lightning.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/br/pkg/lightning/lightning.go b/br/pkg/lightning/lightning.go index 2db76b1001078..daeb7a2d480dc 100644 --- a/br/pkg/lightning/lightning.go +++ b/br/pkg/lightning/lightning.go @@ -15,6 +15,7 @@ package lightning import ( + "cmp" "compress/gzip" "context" "crypto/ecdsa" @@ -900,8 +901,8 @@ func checkSystemRequirement(cfg *config.Config, dbsMeta []*mydump.MDDatabaseMeta tableTotalSizes = append(tableTotalSizes, tb.TotalSize) } } - slices.SortFunc(tableTotalSizes, func(i, j int64) bool { - return i > j + slices.SortFunc(tableTotalSizes, func(i, j int64) int { + return cmp.Compare(j, i) }) topNTotalSize := int64(0) for i := 0; i < len(tableTotalSizes) && i < cfg.App.TableConcurrency; i++ {