github / github/gh-ost

Support triggers [community contribution welcome]

Open
#153 6 comments 0 reactions 0 assignees View on GitHub
enhancement suggested for community contribution
Dominant language
Go
Stars
13.6k
Forks
1.4k
Avg merge
2h 31m
Merged PRs (30d)
4

Description

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:
- as far as I can see, all sorts of triggers could be supported (`before|after`, `insert|delete|update`)
- throughout the migration process, nothing is really done; the `ghost` table should NOT have triggers.
- during the [cut-over phase](https://github.com/github/gh-ost/blob/8fbff6519f37cf1c8769af3520ec2fd12efeff1b/go/logic/migrator.go#L422-L439) we can copy+paste the triggers from original table to _ghost_ table
- Preferably the triggers are read at migration start, not at cut-over phase
- triggers can be applied on the _ghost_ table after the backlog is drained and the tables are in sync (after `this.waitForEventsUpToLock()`)
- triggers must be removed in any case of rollback, and in such case, before `gh-ost` resumes writes onto the _ghost_ tables (no problem if original table resumes writes)
- _Note_ that at this time `gh-ost` supports two types of cut-over, and both must be supported.

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.