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

REPEATABLE READ wrong session fails #9465

Open
RunningJon opened this issue Jul 26, 2021 · 0 comments
Open

REPEATABLE READ wrong session fails #9465

RunningJon opened this issue Jul 26, 2021 · 0 comments

Comments

@RunningJon
Copy link

RunningJon commented Jul 26, 2021

--Session 1
INSERT INTO postgresqlkeyvalue002 (id, name, age, language) VALUES ('id01','Sumeet', 35, 'TestLanguage');
BEGIN; 
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
UPDATE postgresqlkey value002 SET name = 'Sumeet Kumar' where id = 'id01';
select pg_sleep(15);

--Session 2
BEGIN; 
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; 
UPDATE postgresqlkeyvalue002 SET name = 'Sumeet Kumar1' where id = 'id01';
COMMIT;
SELECT * from postgresqlkeyvalue002;

--Session 1
SELECT * from postgresqlkeyvalue002;
COMMIT;
SELECT * from postgresqlkeyvalue002;

Results
Session2: Sumeet Kumar1
Session1: Operation failed. Try again.: Unknown transaction, could be recently aborted: f976e6aa-1893-4c4b-b4e0-72e8d1985b5f

Session2: Operation failed. Try again.: 48b9119e-9c6b-488f-b975- c76ea8824061 Conflicts with higher priority transaction: a154c821- 03d4-4897-a278-2f3baedd4e4b
Session1: Sumeet Kumar

Expected Behavior

  • Session2 should wait until Session1 either executes COMMIT or ROLLBACK.
  • On COMMIT of Session1, Session2 should fail because it couldn't serialize the access.
  • On ROLLBACK of Session1, Session2 should be allowed to continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant