pingcap / pingcap/tidb

`IMPORT INTO` can't be cancelled immediately and stuck at `MakeTableRegions`

Open
#59,834 2 comments 0 reactions 0 assignees View on GitHub
component/ddl severity/moderate type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

If the task need to read massive files before actually start, for example, read parquet or split large CSV in `MakeTableRegions`, this task can't be cancelled immediately.

### 1. Minimal reproduce step (Required)

Use `IMPORT INTO xxx format "parquet"` with massive files and then cancel the job.
(You can also reproduce it using a single large CSV)

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

The import job should be cancelled immediately.

### 3. What did you see instead (Required)

```
mysql> cancel import job 60001;

Query OK, 0 rows affected (30 min 34.75 sec)
```

From the profile we can see that owner node is still scanning files.

![Image](https://github.com/user-attachments/assets/7372bb79-1fa2-48ce-a0ed-6376d8539d9c)

### 4. What is your TiDB version? (Required)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.