-
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
Lock wait timeouts/delays for some concurrent update/insert operations involving lookup vindexes #6604
Comments
Re-open due to fix added in #6736 |
There are 3 session with VTGate open when consistent lookup is involved.
Pre and Post session are used by lookup queries and normal session is used by the original query sent from the client to VTGate. If an insert query is received, insert on Consistent lookup will happen through Pre session and actual query insert will happen through Normal Session, So, when commit happen it happens on Pre first and if it succeeds then commit happens on post session. Similarly when an update/delete query is received, post session is used to do the update/delete on consistent lookup and normal session for original query. Commit order is normal session first if that succeeds then is executed on post session. Anytime there is consistent lookup involved in the query received, a lock needs to be taken so that is not available for other session to be modified. In order to do that we have to select the right session in the beginning. For an update/delete query, POST Session is used to send select.. for update query. Due to this the current limitation with consistent lookup is that it cannot support insert followed by update/delete or otherwise when the consistent lookup column has same value involved. |
Scenario:
Session 1 (note, no hang after the insert ignore):
Session 2 (fails with duplicate entry as look as the insert ignore runs):
As some context, looking at the underlying MySQL instance and the InnoDB engine status output, the lock that Vitess seems to be waiting on after the insert ignore / commit is:
The text was updated successfully, but these errors were encountered: