-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Option to skip locking #215
Comments
What is a distributed formulation?
Locks are implemented by the driver to make running migrate via multiple app instances safe. Note, not every migrate DB driver supports locks. Can you provide specific examples when migration locks cause problems? |
@dhui I think he is referring to MySQL/Percona Cluster which do not support LOCK TABLES in multi-master setup, see: https://www.percona.com/doc/percona-xtradb-cluster/LATEST/limitation.html. Edit: for the record, we ran into this issue as well. :) |
@omissis Thanks for the example and docs! The migrate MySQL db driver is actually using For now, we can add an option to the MySQL db driver to not lock when running migrations. I don't think it makes sense to make a more intrusive change (e.g. add an additional config option) that may confuse users that don't use |
@dhui I started to experiment about it in my fork, but I am not sure I understand your idea: if we only add an option to the driver and not to the command line tool, those users (like me 😬) who run the binary to migrate their tables would still be blocked on cluster instances, wouldn’t they? |
@omissis The options are specified in the DSN e.g. in the connection string |
I see. That would not be part of the built-in mysql.Config object though, and probably would require parsing the query param before passing the connection string to mysql.ParseDSN(), right? I'll try to open a PR later so we can talk looking at some code. edit: @dhui ok I just found the code parsing custom query params :) |
Did a change for this ever get made pulled into the project? I'm trying to get this working with MariaDB right now - I might explore implementing the proposed solution above if it has not yet. |
@omissis Sure. I haven't dug into this codebase yet, can you link me to the spots in the code you were looking at to give me a head start? |
I'm hitting this issue as well, with PXC (Percona Cluster) failing to run migrations due to the GET_LOCKs. Would love to have option to disable the locks, with the caveat that migrations have to be run from single instance app or cli. |
Is your feature request related to a problem? Please describe.
Some database configurations, such as distributed formulations, disable locks by default.
Describe the solution you'd like
Would be helpful for the migrate library and CLI to accept a parameter to not bother using locks, so that golang-migrate can be used to manage schemas for distributed databases.
Describe alternatives you've considered
The text was updated successfully, but these errors were encountered: