github / gh-ost

GitHub's Online Schema-migration Tool for MySQL
MIT License
12.44k stars 1.26k forks source link

Support triggers [community contribution welcome] #153

Open shlomi-noach opened 8 years ago

shlomi-noach commented 8 years ago

Triggers can be supported by gh-ost. This is not on our immediate roadmap, and so it's an ideal opportunity for community contribution.

Some notes:

Anyone who is interested to jump on this please let me know beforehand. Thank you!

allixsenos commented 8 years ago

in the meantime, it might be nice to have a --yes-it-has-triggers-ignore-them option... I'm looking at a 300 GB table which has triggers that I am happy to deal with manually... #152 made gh-ost check and bail on presence of triggers. a method of explicitly overriding that behavior would help greatly

shlomi-noach commented 8 years ago

@allixsenos can you please open a new issue for this so we can track it?

MarkLeith commented 8 years ago

"Preferably the triggers are read at migration start, not at cut-over phase" - why?

Surely reading them at the point you want to recreate them is more correct (what if a trigger is altered during a migration)?

shlomi-noach commented 8 years ago

@MarkLeith you are correct. My initial thought was to save time. The cut-over phase is the time where tables are locked, and I am a bit afraid of spending this time on even more operations.

I can also argue that anyone modifying the triggers while migration is running is on the right track to shooting themselves in the foot.

Having said all that the most ultimatest correctest behavior is to read trigger info while cutting over.

bancer commented 5 years ago

@shlomi-noach Are there any new insights into this issue? I am interested to give it a try.

shlomi-noach commented 5 years ago

@bancer no new insights on my side; I haven't given this thought.