-
-
Notifications
You must be signed in to change notification settings - Fork 513
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
Support for traditional
and consecutive
behavior for innodb_autoinc_lock_mode
#7634
Comments
You are correct, we don't support this variable and have not thought deeply about how Dolt works under concurrency and @jycor will do some research and scope the work required to support these modes. It's possible Dolt's transaction model is already "traditional" or "conservative" and we just need to populate the variable which would be an easy fix. If not, it may be a bit more work to support the exact MySQL behavior. We'll try and scope this today. |
Based off my understanding of the MySQL Docs, Dolt's current transaction model, and Dolt's auto_increment behavior, I think we currently do Interleaved, so I will get started on adding this variable, should take maybe a day or two. |
@arvidfm can you comment on whether having the |
@zachmu In our case we do specifically need to be able to set it to consecutive (or traditional) as we rely on it for bulk inserts; it allows us to correctly calculate the IDs of inserted items without having to either run another query or insert the items one by one, using the method described e.g. here (as MySQL unfortunately doesn't supporting a We don't however require it to be changeable at runtime, so a static configuration value + the ability to query the variable to ensure that it's set correctly would be enough for our purposes |
Thanks for the confirmation. We'll get started on implementing the different modes. |
traditional
and consecutive
behavior for innodb_autoinc_lock_mode
@nicktobey is going to start on this today, we should have this out soon. |
@arvidfm: to clarify, do you require both |
@nicktobey Either is fine as far as we're concerned. Probably |
Thank you for your patience while we investigated and implemented this issue. It should be live in the newest patch release. Feel free to try it out and let us know if you encounter any issues with it! We ending up refactoring some of our mutex logic in order to properly support this, in ways that should improve performance for all lock modes. So that's exciting too! If you have any other requests, comments, or concerns, please let us know and we'll get right on them! |
@nicktobey Wow, that's amazing, thank you so much! I'll definitely give it a spin when I can. Also, sorry I didn't manage to find the time to dig up my Discord account to share our use case, is that something you're still interested in? |
@arvidfm, we are still interested in your use case. :) You can email me at brianf@dolthub.com if that's easier than Discord. |
For MySQL we're currently checking
innodb_autoinc_lock_mode
because our system relies on it being set totraditional
(0) orconsecutive
(1) for bulk inserts to behave as expected, but it seems Dolt doesn't support it:I also couldn't find any documentation on how Dolt handles autoinc IDs by default in regards to locking and interleaving, besides the risk of conflicts across distinct clones (which is not an issue for our use case).
The text was updated successfully, but these errors were encountered: