-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Insert ignore for vindexes without autocommit appear incorrect. #4974
Comments
No that one uses an autocommit vindex so it works. I'm pretty sure the problem is that the insert ignore verify only works when the insert into the vindex has been committed. I suspect we aren't sending the right transaction id during that verify |
Ahh. I see. Looks like I tested the wrong table. Let me try this one out. |
Ok. I believe the test for t2 is still legit, and it would have failed without the ordering fix in that PR. |
Yes t2 is absolutely legit and it fixes the problem we were having. We only use autocommit vindexes. I just found this bug while I was working on this so I wanted to track it somewhere. Note that if you try the insert ignore twice it works because in the first call the vindex is inserted so when the second call is made the verify works. |
Yeah. I found the problem. The fix may be tricky because Verify is used from two different code paths (one for owned, the other unowned), and may have to use different commit order directives. I have to think of a way to do this without changing the Vindex API. |
We are in no rush for a fix for this. I'm glad you found the problem so
quickly though.
…On Tue, Jul 2, 2019 at 1:00 PM Sugu Sougoumarane ***@***.***> wrote:
Yeah. I found the problem. The fix may be tricky because Verify is used
from two different code paths (one of owne, the other unowned), and may
have to use different commit order directives. I have to think of a way to
do this without changing the Vindex API.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4974?email_source=notifications&email_token=AAZFSMORSQN4CSRKTJ2HHELP5OCUNA5CNFSM4H45D252YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZB5PPA#issuecomment-507762620>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAZFSMLJ6SBHLXGDZYSJH7LP5OCUNANCNFSM4H45D25Q>
.
|
Fixes vitessio#4974 Insert ignore wasn't working correctly because the verify was using the normal transaction instead of the 'pre' transaction where the rows were actually created. This implementation changes the consistent lookup's Verify function to also use the 'pre' transaction always. There is another code path that gets used if the vindex is unowned. That will also cause a 'pre' transaction to be created. Without this change, the transaction would have been a normal one. This mildly affects the commit order, but there should be no material difference. Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
I created a test that proves this.
mpawliszyn@8202a11
The text was updated successfully, but these errors were encountered: