Skip to content
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

tidb repeatable read isolation level does not allow phantom read #57440

Open
mzhang77 opened this issue Nov 18, 2024 · 1 comment
Open

tidb repeatable read isolation level does not allow phantom read #57440

mzhang77 opened this issue Nov 18, 2024 · 1 comment
Labels
type/question The issue belongs to a question.

Comments

@mzhang77
Copy link

mzhang77 commented Nov 18, 2024

Bug Report

1. Minimal reproduce step (Required)

Screenshot 2024-11-17 at 8 47 24 PM

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

Per definition:

Repeatable Read: Guarantees that if a transaction reads a row, it will see the same data throughout the transaction, preventing dirty reads and non-repeatable reads but allowing phantom reads.

The test case creates a phantom reads scenario, so the data inserted at t2 should be seen at t3.

3. What did you see instead (Required)

In tidb, at t3 transaction 1 can't see data inserted at t2 by transaction 2.
This is incompatible with Repeatable Read definition. So it's also incompatible with mysql

4. What is your TiDB version? (Required)

mysql> select @@version;
+--------------------+
| @@version          |
+--------------------+
| 8.0.11-TiDB-v7.5.3 |
+--------------------+
1 row in set (0.00 sec)
@mzhang77 mzhang77 added the type/bug The issue is confirmed as a bug. label Nov 18, 2024
@cfzjywxk cfzjywxk added type/question The issue belongs to a question. and removed type/bug The issue is confirmed as a bug. labels Nov 19, 2024
@cfzjywxk
Copy link
Contributor

The transaction snapshot read uses a unified start_ts, and it is by design that t3 cannot see the data written by t2.

Regarding the definition of isolation levels, there are multiple standards. Please refer to the documents:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/question The issue belongs to a question.
Projects
None yet
Development

No branches or pull requests

2 participants