Skip to content

Transaction reads should not interfere with add/update/delete#3163

Merged
Cole-Greer merged 3 commits intoapache:3.7-devfrom
andreachild:TINKERPOP-3142-readTransactions
Jul 25, 2025
Merged

Transaction reads should not interfere with add/update/delete#3163
Cole-Greer merged 3 commits intoapache:3.7-devfrom
andreachild:TINKERPOP-3142-readTransactions

Conversation

@andreachild
Copy link
Copy Markdown
Contributor

@andreachild andreachild commented Jul 24, 2025

https://issues.apache.org/jira/browse/TINKERPOP-3142

Changed TinkerElementContainer to no longer consider element reads as being 'used in a transaction' which should be reserved for element add/update/delete only. This is appropriate for TinkerTransactionGraph because the isolation level is 'read committed'. With this isolation level, we do not need to protect against 'unrepeatable reads' or 'phantom reads'.

Prior to this change, a read-only thread could cause a 'Conflict: element modified in another transaction' error in a separate thread which was attempting add/drop/update.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jul 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.20%. Comparing base (9b46b67) to head (b9055e4).
Report is 352 commits behind head on 3.7-dev.

Additional details and impacted files
@@              Coverage Diff              @@
##             3.7-dev    #3163      +/-   ##
=============================================
+ Coverage      76.14%   76.20%   +0.06%     
- Complexity     13152    13286     +134     
=============================================
  Files           1084     1091       +7     
  Lines          65160    67645    +2485     
  Branches        7285     7371      +86     
=============================================
+ Hits           49616    51552    +1936     
- Misses         12839    13362     +523     
- Partials        2705     2731      +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@andreachild andreachild marked this pull request as ready for review July 24, 2025 04:50
Changed TinkerElementContainer to no longer consider element reads as being 'used in a transaction' which should be reserved for element add/update/delete only. This is appropriate for TinkerTransactionGraph because the isolation level is 'read committed'. With this isolation level, we do not need to protect against 'unrepeatable reads' or 'phantom reads'.

Prior to this change, a read-only thread could cause a 'Conflict: element modified in another transaction' error in a separate thread which was attempting add/drop/update.
@andreachild andreachild force-pushed the TINKERPOP-3142-readTransactions branch from 85d9fc6 to b84a60b Compare July 24, 2025 04:52
@andreachild
Copy link
Copy Markdown
Contributor Author

@vkagamlyk would appreciate a review of this fix, thanks!

@vkagamlyk
Copy link
Copy Markdown
Contributor

Thank you!

VOTE + 1 after adding assertions to tests

@xiazcy
Copy link
Copy Markdown
Contributor

xiazcy commented Jul 24, 2025

VOTE +1 pending CHANGELOG entry, and ideally some updates to reference doc to emphasize that non-repeatable reads and phantom reads are not protected at our isolation level.

@andreachild
Copy link
Copy Markdown
Contributor Author

VOTE +1 pending CHANGELOG entry, and ideally some updates to reference doc to emphasize that non-repeatable reads and phantom reads are not protected at our isolation level.

Thanks, added changelog and updated semantics docs.

@Cole-Greer
Copy link
Copy Markdown
Contributor

VOTE +1. In my opinion the documentation has always been explicit regarding what isolation level we guarantee. I'm not opposed to adding an extra sentence or 2 stating that non-repeatable reads and phantom reads are not covered, but I don't believe it is necessary.

@Cole-Greer Cole-Greer merged commit db36986 into apache:3.7-dev Jul 25, 2025
24 checks passed
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.

5 participants