Skip to content

Canceling adding index job may get stuck #61087

@tangenta

Description

@tangenta

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

#   0x3e7b64f   github.com/pingcap/tidb/pkg/ddl.(*copReqSenderPool).getChunk+0x2f   /workspace/source/tidb/pkg/ddl/index_cop.go:256
#   0x3e7aa63   github.com/pingcap/tidb/pkg/ddl.scanRecords.func1+0x103         /workspace/source/tidb/pkg/ddl/index_cop.go:158
#   0x3e7ae2b   github.com/pingcap/tidb/pkg/ddl.wrapInBeginRollback+0xbb        /workspace/source/tidb/pkg/ddl/index_cop.go:195
#   0x3e7a92b   github.com/pingcap/tidb/pkg/ddl.scanRecords+0x19b           /workspace/source/tidb/pkg/ddl/index_cop.go:142
#   0x3e7a30b   github.com/pingcap/tidb/pkg/ddl.(*copReqSender).run+0x3cb       /workspace/source/tidb/pkg/ddl/index_cop.go:130

One of the goroutines reading the table was blocked on fetching the chunk (which is used to store the index columns of the table), because cancel caused the context done, and the result was not sent to the downstream goroutine that writes the index, which further resulted in the resource leakage when it did not recycle the chunk correctly.

2. What did you expect to see? (Required)

It should not get stuck.

3. What did you see instead (Required)

Get stuck when canceling DDL job.

4. What is your TiDB version? (Required)

v7.5.6

Metadata

Metadata

Assignees

Labels

affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.component/ddlThis issue is related to DDL of TiDB.impact/leakreport/customerCustomers have encountered this bug.severity/majortype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions