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++ {