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

fix(connection): reset document state in between transaction retries #13726

Merged
merged 4 commits into from Aug 13, 2023

Conversation

vkarpov15
Copy link
Collaborator

@vkarpov15 vkarpov15 commented Aug 12, 2023

Fix #13698

Summary

#13698 pointed out that, although we do reset $isNew if the transaction fails, we do not reset $isNew in between transaction retries. So if you save() a document within a transaction that was created outside of a transaction, retrying a transient error will always fail with DocumentNotFoundError.

Some followup work: we should be running transaction tests in CI. I'll look into that. I got transaction tests running in CI

Examples

Copy link
Collaborator

@AbdelrahmanHafez AbdelrahmanHafez left a comment

Choose a reason for hiding this comment

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

One question about the test, otherwise LGTM. Thanks! 👍

@vkarpov15 vkarpov15 merged commit 392f9fa into master Aug 13, 2023
34 checks passed
@hasezoey hasezoey deleted the vkarpov15/gh-13698 branch August 14, 2023 07:44
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.

Connection#transaction: Should reset $isNew during the retry
3 participants