-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ddl operation triggers the implicit commit,ddl operation fails occasionally #24591
Comments
The
From the log, the heartbeat at So the pessimistic transaction which should live up to To solve this, a simple way is decrement the calculated value by one before setting the real safepoint. |
Please edit this comment or add a new comment to complete the following informationNot a bug
Duplicate bug
BugNote: Make Sure that 'component', and 'severity' labels are added 1. Root Cause Analysis (RCA) (optional)2. Symptom (optional)3. All Trigger Conditions (optional)4. Workaround (optional)5. Affected versions6. Fixed versions |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
1、do some transaction operation
mysql> create table t(a int, b varchar(20), primary key(a,b(3)));
ERROR 1105 (HY000): tikv aborts txn: Txn(Mvcc(PessimisticLockNotFound { start_ts: TimeStamp(424884930163769345), key: [116, 128, 0, 0, 0, 0, 0, 27, 42, 95, 105, 128, 0, 0, 0, 0, 0, 0, 1, 3, 128, 0, 0, 0, 0, 0, 0, 1, 1, 103, 114, 101, 97, 116, 32, 109, 101, 255, 0, 0, 0, 0, 0, 0, 0, 0, 247] }))
mysql> create table t(a int, b varchar(20), primary key(a,b(3)));
Query OK, 0 rows affected (0.12 sec)
2. What did you expect to see? (Required)
create table sucessful
3. What did you see instead (Required)
create table fail
mysql> create table t(a int, b varchar(20), primary key(a,b(3)));
ERROR 1105 (HY000): tikv aborts txn: Txn(Mvcc(PessimisticLockNotFound { start_ts: TimeStamp(424884930163769345), key: [116, 128, 0, 0, 0, 0, 0, 27, 42, 95, 105, 128, 0, 0, 0, 0, 0, 0, 1, 3, 128, 0, 0, 0, 0, 0, 0, 1, 1, 103, 114, 101, 97, 116, 32, 109, 101, 255, 0, 0, 0, 0, 0, 0, 0, 0, 247] }))
log:
[2021/05/12 08:46:29.137 +00:00] [INFO] [gc_worker.go:1531] ["[gc worker] sent safe point to PD"] [uuid=5e56bb02384000c] ["safe point"=424884930163769345]
[2021/05/12 08:47:49.771 +00:00] [INFO] [client_batch.go:791] ["recycle idle connection"] [target=172.16.4.202:10162]
[2021/05/12 08:47:49.772 +00:00] [INFO] [client_batch.go:791] ["recycle idle connection"] [target=172.16.4.202:10161]
[2021/05/12 08:54:41.146 +00:00] [INFO] [session.go:2764] ["CRUCIAL OPERATION"] [conn=2933] [schemaVersion=6930] [cur_db=zy] [sql="create table t(a int, b varchar(20), primary key(a,b(3)))"] [user=root@127.0.0.1]
[2021/05/12 08:54:41.160 +00:00] [WARN] [snapshot.go:641] ["2PC failed"] [error="tikv aborts txn: Txn(Mvcc(PessimisticLockNotFound { start_ts: TimeStamp(424884930163769345), key: [116, 128, 0, 0, 0, 0, 0, 27, 42, 95, 105, 128, 0, 0, 0, 0, 0, 0, 1, 3, 128, 0, 0, 0, 0, 0, 0, 1, 1, 103, 114, 101, 97, 116, 32, 109, 101, 255, 0, 0, 0, 0, 0, 0, 0, 0, 247] }))"]
[2021/05/12 08:54:41.161 +00:00] [WARN] [session.go:549] ["can not retry txn"] [conn=2933] [label=general] [error="tikv aborts txn: Txn(Mvcc(PessimisticLockNotFound { start_ts: TimeStamp(424884930163769345), key: [116, 128, 0, 0, 0, 0, 0, 27, 42, 95, 105, 128, 0, 0, 0, 0, 0, 0, 1, 3, 128, 0, 0, 0, 0, 0, 0, 1, 1, 103, 114, 101, 97, 116, 32, 109, 101, 255, 0, 0, 0, 0, 0, 0, 0, 0, 247] }))"] [IsBatchInsert=false] [IsPessimistic=true] [InRestrictedSQL=false] [tidb_retry_limit=10] [tidb_disable_txn_auto_retry=true]
[2021/05/12 08:54:41.161 +00:00] [WARN] [session.go:564] ["commit failed"] [conn=2933] ["finished txn"="Txn{state=invalid}"] [error="tikv aborts txn: Txn(Mvcc(PessimisticLockNotFound { start_ts: TimeStamp(424884930163769345), key: [116, 128, 0, 0, 0, 0, 0, 27, 42, 95, 105, 128, 0, 0, 0, 0, 0, 0, 1, 3, 128, 0, 0, 0, 0, 0, 0, 1, 1, 103, 114, 101, 97, 116, 32, 109, 101, 255, 0, 0, 0, 0, 0, 0, 0, 0, 247] }))"]
[2021/05/12 08:54:41.161 +00:00] [INFO] [tidb.go:242] ["rollbackTxn for ddl/autocommit failed"]
[2021/05/12 08:54:41.161 +00:00] [WARN] [session.go:1429] ["run statement failed"] [conn=2933] [schemaVersion=6930] [error="tikv aborts txn: Txn(Mvcc(PessimisticLockNotFound { start_ts: TimeStamp(424884930163769345), key: [116, 128, 0, 0, 0, 0, 0, 27, 42, 95, 105, 128, 0, 0, 0, 0, 0, 0, 1, 3, 128, 0, 0, 0, 0, 0, 0, 1, 1, 103, 114, 101, 97, 116, 32, 109, 101, 255, 0, 0, 0, 0, 0, 0, 0, 0, 247] }))"] [session="{\n "currDBName": "zy",\n "id": 2933,\n "status": 2,\n "strictMode": true,\n "user": {\n "Username": "root",\n "Hostname": "127.0.0.1",\n "CurrentUser": false,\n "AuthUsername": "root",\n "AuthHostname": "%"\n }\n}"]
4. What is your TiDB version? (Required)
Release Version: v5.0.1
Edition: Community
Git Commit Hash: 1145e34
Git Branch: heads/refs/tags/v5.0.1
UTC Build Time: 2021-04-23 05:51:17
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
The text was updated successfully, but these errors were encountered: