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

Make Scalar DB transactions be able to abort eagerly #238

Merged
merged 3 commits into from
Jul 6, 2021

Conversation

brfrn169
Copy link
Collaborator

@brfrn169 brfrn169 commented Jul 6, 2021

@brfrn169 brfrn169 added the enhancement New feature or request label Jul 6, 2021
@brfrn169 brfrn169 requested a review from feeblefakie July 6, 2021 02:03
@brfrn169 brfrn169 self-assigned this Jul 6, 2021
Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

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

Thank you!
The code looks good.
I'm just wondering if we should return UNKNOWN for unsupported operations.

@@ -140,6 +140,11 @@ public TransactionState getState(String txId) {
return TransactionState.UNKNOWN; // always returns UNKNOWN
}

@Override
public TransactionState abort(String txId) {
return TransactionState.UNKNOWN; // always returns UNKNOWN
Copy link
Contributor

Choose a reason for hiding this comment

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

I rethought this method and getState method.
I now think it's better to throw an exception since the application cannot rely on the APIs.
(I think, If UNKNOWN is returned, users would expect if it is returning something else sometimes or eventually)
Thought?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you for reviewing this!

Yes, I agree that the methods should throw an exception (UnsupportedOperationException) in the JDBC transaction. I will fix it in that way. Thanks!

@brfrn169 brfrn169 requested a review from feeblefakie July 6, 2021 04:35
feeblefakie
feeblefakie previously approved these changes Jul 6, 2021
Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@feeblefakie
Copy link
Contributor

@brfrn169 Sorry, please rebuild the rpc to resolve the conflict.

@brfrn169 brfrn169 force-pushed the make-transactions-be-able-to-abort-eagerly branch from 02337c9 to d6290e9 Compare July 6, 2021 05:04
@brfrn169
Copy link
Collaborator Author

brfrn169 commented Jul 6, 2021

@feeblefakie I rebased this to fix the conflicts. Please take a look at it!

@brfrn169 brfrn169 requested a review from feeblefakie July 6, 2021 05:06
@feeblefakie feeblefakie merged commit 6bd6688 into master Jul 6, 2021
@feeblefakie feeblefakie deleted the make-transactions-be-able-to-abort-eagerly branch July 6, 2021 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants