-
Notifications
You must be signed in to change notification settings - Fork 803
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 retry_on_conflict raising errors on document update #1461
Fix retry_on_conflict raising errors on document update #1461
Conversation
💚 CLA has been signed |
my apologies. I thought I clicked submit but the form already timed out. I already signed the form and downloaded the finished copy. Is there a way to correct this after making the PR? |
Thanks for the PR. You're removing Potentially the fix should be: # Optimistic concurrency control
if retry_on_conflict in (None, 0) and "seq_no" in self.meta and "primary_term" in self.meta:
doc_meta["if_seq_no"] = self.meta["seq_no"]
doc_meta["if_primary_term"] = self.meta["primary_term"] and you'll need to update the PR with a test case as well. |
Hey @sethmlarson thanks for looking into my PR The context for me is: I have two separate kafka consumers independently updating the same document. There's a race condition that happens where both consumers get the same document version and update it. When it happens I get the following
From the request params and the error message I made a guess that it was because version was in the query the params. So when I override the version by doing the following on my own code, version disappears and the request pushes through
after looking deeper into the problem I realized that the |
b99fa9c
to
2e86830
Compare
8782fc9
to
0172d6e
Compare
0172d6e
to
39f8f97
Compare
CLA is still falling, did you sign with the same email address attached to your commits? If not it won't go to green. |
Also if you're interested in fixing 6.x you could open a PR against 6.x :) |
39f8f97
to
82073de
Compare
hey @sethmlarson yeah I'm going to fix that. I misunderstood the contribution doc Yes I am interested in working on a fix for 6.x. I'll try to get on that when I can |
82073de
to
ac8a4e7
Compare
ac8a4e7
to
6809621
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks so much for this! I added an extra test case for retry_on_conflict=0
or None
thank you, too, @sethmlarson it was a great learning experience. btw I'm not sure where the best place is to ask this: how do I make a bug fix for 6.x? I don't see a 6.x branch in this repo |
@armando1793 Great catch! I pushed a |
Closes #1432
Closes #1316