pingcap / pingcap/tidb

TiDB locks the record which is filtered by the non-index condition in point-get plan at RC isolation

Open
#37,653 3 comments 0 reactions 0 assignees View on GitHub
affects-5.0 affects-5.1 affects-5.2 affects-5.3 affects-5.4 affects-6.0 affects-6.1 affects-6.2 affects-6.3 affects-6.4 affects-6.5 may-affects-4.0 severity/moderate sig/transaction type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!
RC isolation
### 1. Minimal reproduce step (Required)
create table t1(id1 int, id2 int, id3 int, PRIMARY KEY(id1), UNIQUE KEY udx_id2 (id2));
INSERT INTO t1 VALUES(1,1,1);
-- session1
begin;
select * from t1 where id1 = 1 and id2 = 2 for update;
-- session2
begin
select * from t1 where id1 = 1 for update;

### 2. What did you expect to see? (Required)
session2 returns the result immediately.

### 3. What did you see instead (Required)
session2 was blocked by the lock of the key whose values is ```
### 4. What is your TiDB version? (Required)

Release Version: v6.2.0
Edition: Community
Git Commit Hash: daf2b17cdfe30c02ce282361009fb5bdb05f2b0e

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.