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

Support repeatable read and serializable isolation level #1695

Merged

Conversation

tanscorpio7
Copy link
Contributor

@tanscorpio7 tanscorpio7 commented Aug 8, 2023

Description

Currently we do not support repeatable read and serializable isolation levels.
With this PR
BABEL repeatable read → PG repeatable read (if repeatable read escape hatch is set to pg_isolation)
BABEL serializable → PG serializable (if serializable escape hatch is set to pg_isolation)

REPEATABLE READ GUC:- 'repeatable_read_isolation'
SERIALIZABLE GUC:- 'serializable_isolation'

Issues Resolved

BABEL-4146 & BABEL-4145

Test Scenarios Covered

JDBC : Setting the GUC/ setting all different isolation level.
Python : Concurrent transaction run with one of them being repeatable read while other is read committed. Steps like select, update, delete, insert are used. Different permutations are run to force read/write, write/write concurrency.

Signed-off-by: Tanzeel Khan [email protected]

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@tanscorpio7 tanscorpio7 changed the title Fix: add support to handle repeatable read as snapshot isolation level tsql Fix: add support to handle repeatable read and serializable isolation level as snapshot isolation level tsql Aug 13, 2023
@tanscorpio7 tanscorpio7 changed the title Fix: add support to handle repeatable read and serializable isolation level as snapshot isolation level tsql Fix: add support for repeatable read and serializable isolation level Aug 17, 2023
contrib/babelfishpg_tsql/src/guc.c Outdated Show resolved Hide resolved
contrib/babelfishpg_tsql/src/guc.c Outdated Show resolved Hide resolved
test/JDBC/expected/BABEL-3214.out Outdated Show resolved Hide resolved
test/python/input/isolation/BABEL-4146.spec Show resolved Hide resolved
test/python/input/isolation/BABEL-4146.spec Outdated Show resolved Hide resolved
test/python/expected/pyodbc/BABEL-4146.out Outdated Show resolved Hide resolved
Copy link
Contributor

@surendravishnoi surendravishnoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update commit message to only have change description (remove guidelines)

contrib/babelfishpg_tsql/src/guc.c Outdated Show resolved Hide resolved
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Tanzeel Khan <[email protected]>
@tanscorpio7 tanscorpio7 changed the title Fix: add support for repeatable read and serializable isolation level Support PG repeatable read and serializable isolation level Oct 19, 2023
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Tanzeel Khan <[email protected]>
contrib/babelfishpg_tsql/sql/sys_procedures.sql Outdated Show resolved Hide resolved
contrib/babelfishpg_tsql/src/guc.c Outdated Show resolved Hide resolved
test/JDBC/expected/BABEL_4145.out Outdated Show resolved Hide resolved
@tanscorpio7 tanscorpio7 changed the title Support PG repeatable read and serializable isolation level Support repeatable read and serializable isolation level Oct 23, 2023
Signed-off-by: Tanzeel Khan <[email protected]>
@@ -1207,6 +1212,8 @@ int escape_hatch_rowversion = EH_STRICT;
int escape_hatch_showplan_all = EH_STRICT;
int escape_hatch_checkpoint = EH_IGNORE;
int escape_hatch_set_transaction_isolation_level = EH_STRICT;
int pltsql_isolation_level_repeatable_read = ISOLATION_OFF;
int pltsql_isolation_level_serializable = ISOLATION_OFF;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this it is off, both are 2 tabs & 1 space

contrib/babelfishpg_tsql/src/guc.c Outdated Show resolved Hide resolved
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Tanzeel Khan <[email protected]>
@shardgupta shardgupta merged commit 9fab304 into babelfish-for-postgresql:BABEL_3_X_DEV Oct 26, 2023
27 checks passed
@tanscorpio7 tanscorpio7 deleted the BABEL_4146 branch December 12, 2023 08:29
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

Successfully merging this pull request may close these issues.

3 participants