potential data race on add index when other routine exit due to error but adjust worker size routine keeps running #59016
Labels
affects-8.5
This bug affects the 8.5.x(LTS) versions.
component/ddl
This issue is related to DDL of TiDB.
severity/moderate
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
the task sender routine A uses error group context
tidb/pkg/ddl/backfilling.go
Lines 1039 to 1040 in 889bf45
but the adjust worker size routine B uses parent ctx
tidb/pkg/ddl/backfilling.go
Lines 1074 to 1081 in 889bf45
so if A failed with error, cause error group context cancelled, B keeps running, so we might met potential data race in
tidb/pkg/ddl/backfilling_scheduler.go
Line 342 in 889bf45
and
tidb/pkg/ddl/backfilling_scheduler.go
Line 322 in 889bf45
we should use the same context, and run together under the same group. introduced in #57468
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
master
The text was updated successfully, but these errors were encountered: