"ERROR 1062 (23000): Duplicate entry" on data insert for the truncated table restored with TiDB BR restore #42205
Labels
affects-6.5
This bug affects the 6.5.x(LTS) versions.
affects-7.0
affects-7.1
This bug affects the 7.1.x(LTS) versions.
component/br
This issue is related to BR of TiDB.
may-affects-4.0
This bug maybe affects 4.0.x versions.
may-affects-5.0
This bug maybe affects 5.0.x versions.
may-affects-5.1
This bug maybe affects 5.1.x versions.
may-affects-5.2
This bug maybe affects 5.2.x versions.
may-affects-5.3
This bug maybe affects 5.3.x versions.
may-affects-5.4
This bug maybe affects 5.4.x versions.
may-affects-6.1
severity/major
type/bug
The issue is confirmed as a bug.
Bug Report
1. Minimal reproduce step (Required)
[2023/03/14 15:11:17.552 +08:00] [INFO] [conn.go:1152] ["command dispatched failed"] [conn=359373176515330469] [connInfo="id:359373176515330469, addr:172.23.99.214:59182 status:10, collation:utf8_general_ci, user:root"] [command=Query] [status="inTxn:0, autocommit:1"] [sql="insert into t3 values ("22")"] [txn_mode=PESSIMISTIC] [timestamp=440081547929321473] [err="[kv:1062]Duplicate entry '1' for key 't3.PRIMARY'"]
[2023/03/14 15:11:20.477 +08:00] [INFO] [conn.go:1152] ["command dispatched failed"] [conn=359373176515330469] [connInfo="id:359373176515330469, addr:172.23.99.214:59182 status:10, collation:utf8_general_ci, user:root"] [command=Query] [status="inTxn:0, autocommit:1"] [sql="insert into t3 values ("23")"] [txn_mode=PESSIMISTIC] [timestamp=440081548689276929] [err="[kv:1062]Duplicate entry '2' for key 't3.PRIMARY'"]
[2023/03/14 15:11:27.935 +08:00] [INFO] [conn.go:1152] ["command dispatched failed"] [conn=359373176515330469] [connInfo="id:359373176515330469, addr:172.23.99.214:59182 status:10, collation:utf8_general_ci, user:root"] [command=Query] [status="inTxn:0, autocommit:1"] [sql="insert into t3 values ("24")"] [txn_mode=PESSIMISTIC] [timestamp=440081550642249732] [err="[kv:1062]Duplicate entry '3' for key 't3.PRIMARY'"]
[2023/03/14 15:11:31.369 +08:00] [INFO] [conn.go:1152] ["command dispatched failed"] [conn=359373176515330469] [connInfo="id:359373176515330469, addr:172.23.99.214:59182 status:10, collation:utf8_general_ci, user:root"] [command=Query] [status="inTxn:0, autocommit:1"] [sql="insert into t3 values ("25")"] [txn_mode=PESSIMISTIC] [timestamp=440081551546646531] [err="[kv:1062]Duplicate entry '4' for key 't3.PRIMARY'"]
[2023/03/14 15:11:34.019 +08:00] [INFO] [conn.go:1152] ["command dispatched failed"] [conn=359373176515330469] [connInfo="id:359373176515330469, addr:172.23.99.214:59182 status:10, collation:utf8_general_ci, user:root"] [command=Query] [status="inTxn:0, autocommit:1"] [sql="insert into t3 values ("26")"] [txn_mode=PESSIMISTIC] [timestamp=440081552241328132] [err="[kv:1062]Duplicate entry '5' for key 't3.PRIMARY'"]
[2023/03/14 15:11:35.730 +08:00] [INFO] [conn.go:1152] ["command dispatched failed"] [conn=359373176515330469] [connInfo="id:359373176515330469, addr:172.23.99.214:59182 status:10, collation:utf8_general_ci, user:root"] [command=Query] [status="inTxn:0, autocommit:1"] [sql="insert into t3 values ("26")"] [txn_mode=PESSIMISTIC] [timestamp=440081552686972929] [err="[kv:1062]Duplicate entry '6' for key 't3.PRIMARY'"]
2. What did you expect to see? (Required)
For the truncated table , after br restore , insert data onto the table should be working as normal.
3. What did you see instead (Required)
It shows error as "ERROR 1062 (23000): Duplicate entry 'x' for key 'xxx'
4. What is your TiDB version? (Required)
6.5.0
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v6.5.0
Edition: Community
Git Commit Hash: 706c3fa
Git Branch: heads/refs/tags/v6.5.0
UTC Build Time: 2022-12-27 03:50:44
GoVersion: go1.19.3
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.03 sec)
MySQL [bookshop]>
The text was updated successfully, but these errors were encountered: