-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.component/ddlThis issue is related to DDL of TiDB.This issue is related to DDL of TiDB.severity/moderatetype/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.
Description
Enhancement
Currently, we use available memory to determine writer memory size when read-index stage starts.
tidb/pkg/ddl/backfilling_operators.go
Lines 120 to 128 in 8a10278
memTotal, err := memory.MemTotal() | |
if err != nil { | |
return 0, err | |
} | |
memUsed, err := memory.MemUsed() | |
if err != nil { | |
return 0, err | |
} | |
memAvailable := memTotal - memUsed |
This value can be different under different workloads. As a result, we may encounter the error "merge sort multi parts exceed 10000", because we cannot make sure the following formula if memsize
is unstable:
partsize * 10000 >= 4000 * memsize
Metadata
Metadata
Assignees
Labels
affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.component/ddlThis issue is related to DDL of TiDB.This issue is related to DDL of TiDB.severity/moderatetype/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.