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

[YSQL] Disallow changing from read-write to read-only transaction if using serializable isolation #23008

Open
1 task done
pkj415 opened this issue Jun 25, 2024 · 0 comments
Open
1 task done
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage

Comments

@pkj415
Copy link
Contributor

pkj415 commented Jun 25, 2024

Jira Link: DB-11930

Description

Pg allows changing a read-write transaction to read-only even after executing a few writes in a transaction block. This is the case in YB too, and is okay for RC/ RR isolation levels. But for serializable isolation level, we face the following issue:

create table test (k int primary key, v int);
yugabyte=# begin transaction isolation level serializable;
BEGIN
yugabyte=# insert into test values (4, 4);
INSERT 0 1
yugabyte=# set transaction_read_only=true;
SET
yugabyte=# select * from test;
ERROR:  Attempt to change effective isolation from 2 to SNAPSHOT_ISOLATION in the middle of a transaction. Postgres-level isolation: SERIALIZABLE; read_only: 1.
yugabyte=#

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@pkj415 pkj415 added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels Jun 25, 2024
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage
Projects
Status: No status
Development

No branches or pull requests

2 participants