pingcap / pingcap/tidb

Unexpected transaction behavior

Open
#40,575 1 comment 0 reactions 0 assignees View on GitHub
type/question
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

transaction commit,discovery ERROR 8027 (HY000): Information schema is out of date: schema failed to update in 1 lease, please make sure TiDB can connect to TiKV

### 1. Minimal reproduce step (Required)

mysql> select version();
+--------------------+
| version() |
+--------------------+
| 5.7.25-TiDB-v6.5.0 |
+--------------------+
1 row in set (0.00 sec)

mysql>
mysql> select * from sbtest6;
+----+-----+-----+-----+------+---------------------------------------------------------------------------+
| id | k | c | pad | city | browser |
+----+-----+-----+-----+------+---------------------------------------------------------------------------+
| 1 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 2 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 3 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 4 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 5 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 6 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 7 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 8 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 9 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 10 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 11 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 12 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 13 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 14 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 15 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 16 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 17 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 18 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 19 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 20 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 21 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 22 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 23 | 123 | 123 | 123 | 123 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
| 24 | 123 | 123 | 123 | 456 | {"name": "Firefox", "os": "Windows", "resolution": {"x": 1600, "y": 900}} |
+----+-----+-----+-----+------+---------------------------------------------------------------------------+
24 rows in set (0.04 sec)

--- T1
--- trx1
mysql> begin;
Query OK, 0 rows affected (0.00 sec)

mysql> update sbtest6 set city='456' where id=24;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0

--- T2
--- trx2
mysql> begin;
Query OK, 0 rows affected (0.00 sec)

mysql> update sbtest6 set city='456' where id=24;

block

--- T3
--- trx2
ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

--- T4
--- trx1
mysql> commit;
ERROR 8027 (HY000): Information schema is out of date: schema failed to update in 1 lease, please make sure TiDB can connect to TiKV

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

trx1 commit succees
### 3. What did you see instead (Required)
ERROR 8027 (HY000): Information schema is out of date: schema failed to update in 1 lease, please make sure TiDB can connect to TiKV
### 4. What is your TiDB version? (Required)

mysql> select version();
+--------------------+
| version() |
+--------------------+
| 5.7.25-TiDB-v6.5.0 |
+--------------------+
1 row in set (0.00 sec)

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.