Skip to content

storage: don't return status error on rollbacks#28344

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
andreimatei:rollback-no-txn-rec
Aug 8, 2018
Merged

storage: don't return status error on rollbacks#28344
craig[bot] merged 1 commit intocockroachdb:masterfrom
andreimatei:rollback-no-txn-rec

Conversation

@andreimatei
Copy link
Copy Markdown
Contributor

Before this patch, EndTransaction(commit=false) would return
TransactionStatusError if the txn record was not found (just like a
commit). This patch makes it return success (and an unmodified txn proto
in the response).
The motivation is that the client is routinely sending rollbacks in
situations where it's unclear whether the txn record has previously been
written successfully. We currently mostly swallow those errors on the
client, but that code is ugly and incomplete - the client sometimes turn
commits into rollbacks if all writes have been performed at an old
epoch. In that case we have a problem because, if the rollback encouters
the error, we might not have the responses for other requests in its
batch. So, I will take the client out of the business of massaging
these errors.

Release note: none

@andreimatei andreimatei requested a review from a team August 7, 2018 18:06
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@andreimatei andreimatei force-pushed the rollback-no-txn-rec branch 2 times, most recently from 7a92171 to 9dcd64a Compare August 7, 2018 19:58
@andreimatei andreimatei requested review from a team August 7, 2018 19:58
@andreimatei andreimatei force-pushed the rollback-no-txn-rec branch from 9dcd64a to 3192d52 Compare August 7, 2018 20:51
Copy link
Copy Markdown
Contributor

@bdarnell bdarnell left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained

@andreimatei
Copy link
Copy Markdown
Contributor Author

andreimatei commented Aug 8, 2018 via email

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 8, 2018

Build failed

Before this patch, EndTransaction(commit=false) would return
TransactionStatusError if the txn record was not found (just like a
commit). This patch makes it return success (and an unmodified txn proto
in the response).
The motivation is that the client is routinely sending rollbacks in
situations where it's unclear whether the txn record has previously been
written successfully. We currently mostly swallow those errors on the
client, but that code is ugly and incomplete - the client sometimes turn
commits into rollbacks if all writes have been performed at an old
epoch. In that case we have a problem because, if the rollback encouters
the error, we might not have the responses for other requests in its
batch. So, I will take the client out of the business of massaging
these errors.

Release note: none
@andreimatei andreimatei force-pushed the rollback-no-txn-rec branch from 3192d52 to 408f335 Compare August 8, 2018 18:53
Copy link
Copy Markdown
Contributor Author

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

bors r+

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained

craig bot pushed a commit that referenced this pull request Aug 8, 2018
28344: storage: don't return status error on rollbacks r=andreimatei a=andreimatei

Before this patch, EndTransaction(commit=false) would return
TransactionStatusError if the txn record was not found (just like a
commit). This patch makes it return success (and an unmodified txn proto
in the response).
The motivation is that the client is routinely sending rollbacks in
situations where it's unclear whether the txn record has previously been
written successfully. We currently mostly swallow those errors on the
client, but that code is ugly and incomplete - the client sometimes turn
commits into rollbacks if all writes have been performed at an old
epoch. In that case we have a problem because, if the rollback encouters
the error, we might not have the responses for other requests in its
batch. So, I will take the client out of the business of massaging
these errors.

Release note: none

Co-authored-by: Andrei Matei <andrei@cockroachlabs.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 8, 2018

Build succeeded

@craig craig bot merged commit 408f335 into cockroachdb:master Aug 8, 2018
@andreimatei andreimatei deleted the rollback-no-txn-rec branch August 8, 2018 23:08
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