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

CORE-19229 - Remove transactions from StateManager read operations. #5401

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

driessamyn
Copy link
Contributor

No description provided.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

PR title failed to match regex -> ^((CORDA|EG|ENT|INFRA|CORE|DOC|ES|DA5|DI)-\d+)(.*)

@driessamyn driessamyn changed the title Remove transactions from StatManager read operations. Remove transactions from StateManager read operations. Jan 9, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

PR title failed to match regex -> ^((CORDA|EG|ENT|INFRA|CORE|DOC|ES|DA5|DI)-\d+)(.*)

Copy link

sonarqubecloud bot commented Jan 9, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@corda-jenkins-ci02
Copy link
Contributor

Jenkins build for PR 5401 build 1

Build Successful:
Jar artifact version produced by this PR: 5.2.0.0-alpha-1704813643707
Helm chart version produced by this PR: 5.2.0-alpha.1704813643707
Helm chart pushed to: oci://corda-os-docker-dev.software.r3.com/helm-charts/pr-5401/corda

@driessamyn driessamyn changed the title Remove transactions from StateManager read operations. CORE-19229 - Remove transactions from StateManager read operations. Jan 9, 2024
@driessamyn driessamyn marked this pull request as ready for review January 9, 2024 18:00
@github-actions github-actions bot dismissed stale reviews from themself January 9, 2024 18:00

All good!

Copy link
Contributor

@ifrankrui ifrankrui left a comment

Choose a reason for hiding this comment

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

First of all, whether a read operation executes within an explicit transaction or not, it still runs within a transaction context. The database implicitly starts a transaction for each statement, even if it's not explicitly wrapped in a BEGIN and COMMIT block. This is a standard behavior in PostgreSQL (PostgreSQL Transactions Documentation).

Secondly, regarding the default isolation level, our specification in Corda is set to Read Committed ( Corda Runtime OS - TransactionIsolationLevel.kt). This matches the default isolation level of PostgreSQL, which is also Read Committed. Therefore, from a data integrity perspective, using the default settings does not compromise the data integrity here.

Regarding the intention to remove the transaction for the read operation, using use { ... } might indeed be more efficient and simpler, potentially leading to some performance gains. While the impact might be minimal for a few statements, it could be more measurable for a large number of select queries.

Copy link
Collaborator

@Omar-awad Omar-awad left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jujoramos jujoramos left a comment

Choose a reason for hiding this comment

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

LGTM

@driessamyn driessamyn merged commit 03c772b into release/os/5.2 Jan 10, 2024
7 checks passed
@driessamyn driessamyn deleted the driessamyn/remove-tx-in-sm-get branch January 10, 2024 13:05
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.

4 participants