Skip to content

txn: the update could not read the latest data if read committed is used. #41581

Closed
@cfzjywxk

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

init
set global tidb_txn_mode = 'pessimistic';
set global tx_isolation = 'READ-COMMITTED';
create table t(a int key, b int);
session 1
begin pessimistic;

session 2
insert into t values(5, 5);

session 1
update t set b = 22 where a = 5;

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

mysql> update t set b = 22 where a = 5;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

3. What did you see instead (Required)

mysql> update t set b = 22 where a = 5;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0  Changed: 0  Warnings: 0

The update could not read the latest data, this is possibly a bug introduced during the refactoring of the transaction module in tidb, after #34702 the bug is fixed, but v6.1.x and v6.0.0 are affected.

4. What is your TiDB version? (Required)

tidb v6.0.0 v6.1.x

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions