[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] 7.5.1
[Reproduction Path] Partitioning a table with tens of millions of rows online
Table structure
CREATE TABLE test (
col1 INT NOT NULL,
col2 INT NOT NULL,
col3 INT NOT NULL,
UNIQUE KEY (col1, col2),
UNIQUE KEY (col1, col3)
);
Alter statement
ALTER TABLE test PARTITION BY KEY(col1) PARTITIONS 4;
[Encountered Problem: Problem Phenomenon and Impact]
The online modification process gets interrupted
Error reported: ERROR 1062 (23000) at line 1: Duplicate entry ‘col1_value–col12_value’ for key ‘test.col1’
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots / Logs / Monitoring]
I’m using version 7.5.1. I’m not sure if the Duplicate of online data insertion caused the sharding error. I didn’t stop the machine to maintain the sharding. I tried other tables before, and they could be sharded normally, but this one doesn’t work.