Skip to content

load data with auto-random may panic if too many rows #22540

@wjhuang2016

Description

@wjhuang2016

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Prepare a CSV file with more than 60000 rows.
Create a table with auto-random.
Use the load statement to load the data.

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

Load data successfully.

3. What did you see instead (Required)

ERROR 2013 (HY000) at line 1: Lost connection to MySQL server during query

4. What is your TiDB version? (Required)

4.0.4

Root cause:
When load executes, there are two parts. processStream() produces the data. CommitWork() commit the data.
They use the same txn. Between CommitWork() committing the txn and start a new txn. processStream() may use the invalid txn to get the auto-random value, then the get empty data return an error. But we take the error as a warning:
image
Finally, when using the data, tidb-server panics.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions