-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[YSQL] READ COMMITTED definition violation #17018
Comments
Hi @Coconut-DB1024, by default the "read committed" still maps to repeatable reads. Since read commited have been implemented, it must be enabled by starting the tablet servers with: and then your example has the same behavior as PostgreSQL:
|
Hi, @FranckPachot, I think ydb should fix this issue, so as to compatiable with PostgreSQL. |
Hi,@FranckPachot, it might be confusing when I run |
@wengsy150943 Yes, that's right, because of some backward compatibility with versions where Read Committed was not implemented yet. |
@Coconut-DB1024 you should set |
To add more context see: https://www.postgresql.org/docs/11/transaction-iso.html However, as we are aiming for Postgres compatibility we are planning to eventually have the same default behavior as Postgres. |
Jira Link: DB-6332
Description
When runing a workload on the lasted version of YugabyteDB, we finds that a query violates the definition of READ COMMITTED isolation levels.
We have run the same workload on PostgreSQL, the violation does not happen.
More specifically, as shown in the following table, the workload first launches a read committed transaction (ID=0) to query the record (k=62).
Next, the workload launches another read committed transaction (ID=19) to modify the record (k=3) and commit.
Finally, the transaction (ID=0) queries the record (k=3).
The expect query result is the transaction (ID=0) fetches the lasted version of the record (k=3), that is, 15574 installed by the transaction (ID=19).
However, the acctual query result is 28703, which violate the definition of default isolation level READ COMMITTED.
The default isolation level READ COMMITTED should see the data committed before the query began.
YugabyteDB version we use is PostgreSQL 11.2-YB-2.17.2.0-b0 on x86_64-pc-linux-gnu, compiled by clang version 15.0.3 (https://github.com/yugabyte/llvm-project.git 0b8d1183745fd3998d8beffeec8cbe99c1b20529), 64-bit.
Note that, the database schema and the initial datbase are as follows
drop database if exists "reproduceDB";
create database "reproduceDB";
create table table0 (k int primary key, v int);
insert into table0 values(3, 28703);
insert into table0 values(62, 16541);
Warning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: