From d56328579ef8a4566081197b283b78d61931ae7d Mon Sep 17 00:00:00 2001 From: D3Hunter Date: Fri, 5 Jan 2024 11:28:01 +0800 Subject: [PATCH] change --- br/pkg/lightning/config/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/br/pkg/lightning/config/config.go b/br/pkg/lightning/config/config.go index c5f181614f971..5e7c96d62794d 100644 --- a/br/pkg/lightning/config/config.go +++ b/br/pkg/lightning/config/config.go @@ -332,6 +332,11 @@ func (l *Lightning) adjust(i *TikvImporter) { if len(l.MetaSchemaName) == 0 { l.MetaSchemaName = defaultMetaSchemaName } + // RegionConcurrency > NumCPU is meaningless. + cpuCount := runtime.NumCPU() + if l.RegionConcurrency > cpuCount { + l.RegionConcurrency = cpuCount + } } }