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

[2201.8.x] Remove the strandId when doing generateCombinedTransactionId in TransactionResourceManager #42119

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

dsplayerX
Copy link
Contributor

@dsplayerX dsplayerX commented Feb 6, 2024

Purpose

When there is a separate strand created for a transaction block it registers in the resourceRegistry with its strandID. Finally when we commit the original transaction with the main strand and we look in the resourceRegistry With the main strandID and the results will be zero. Hence, the transaction won’t be committed.

Since resourceRegistry is a map that holds list of BallerinaTransactionContexts for a given transaction block, we can prevent adding strandID to the keys of resourceRegistry which will fix the mismatch because of different strands.

Fixes #41682

Approach

Remove strandId when doing generateCombinedTransactionId in TransactionResourceManager

Samples

Test cases added via ballerina-platform/module-ballerina-sql#698

Remarks

[master] PR: #41800

Check List

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

When there is a separate strand created for a transaction block it registers in the `resourceRegistry` with its strandID. Finally when we commit the original transaction with the main strand and we look in the `resourceRegistry` With the main strandID and the results will be zero. Hence, the transaction won’t be committed.

Since  `resourceRegistry` is a  map that holds list of `BallerinaTransactionContext`s for a given transaction block, we can prevent adding strandID to the keys of `resourceRegistry` which will fix the mismatch because of different strands.

(cherry picked from commit 8fa2ffa)
Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (607da82) 76.30% compared to head (8a4187b) 76.30%.
Report is 6 commits behind head on 2201.8.x.

Files Patch % Lines
...ntime/transactions/TransactionResourceManager.java 0.00% 2 Missing ⚠️
...lerinalang/compiler/tree/BLangTestablePackage.java 50.00% 2 Missing ⚠️
...o2/ballerinalang/compiler/desugar/MockDesugar.java 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             2201.8.x   #42119   +/-   ##
===========================================
  Coverage       76.30%   76.30%           
- Complexity      52566    52567    +1     
===========================================
  Files            2880     2880           
  Lines          198959   198946   -13     
  Branches        25868    25858   -10     
===========================================
+ Hits           151806   151810    +4     
+ Misses          38795    38784   -11     
+ Partials         8358     8352    -6     

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

@dsplayerX dsplayerX marked this pull request as ready for review February 7, 2024 04:03
@gimantha gimantha merged commit 74d366c into ballerina-platform:2201.8.x Mar 5, 2024
6 of 7 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.

4 participants