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

Handle DOCUMENT_ALREADY_EXISTS error on insert #802

Merged
merged 7 commits into from
Jan 16, 2024

Conversation

maheshrajamani
Copy link
Contributor

@maheshrajamani maheshrajamani commented Jan 16, 2024

What this PR does:
Check LWT error for insert's are because of WTE retries.

Which issue(s) this PR fixes:
Fixes #801

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

…what was attempted as part of the insert. This is possible if WTE exception happens and retry of the row gets LWT error.
@maheshrajamani maheshrajamani self-assigned this Jan 16, 2024
@maheshrajamani maheshrajamani requested a review from a team as a code owner January 16, 2024 18:50
final UUID txId = result.one().getUuid("tx_id");
if (doc.txID().equals(txId)) {
return Uni.createFrom().item(doc.id());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Three retry will have the same txId, is that correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, retries are done by the driver with the same bind values

@maheshrajamani maheshrajamani merged commit 0e54228 into main Jan 16, 2024
2 checks passed
@maheshrajamani maheshrajamani deleted the concurrent-insert-error branch January 16, 2024 21:37
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.

Handle DOCUMENT_ALREADY_EXISTS error in insert
2 participants