github / github/gh-ost

Support triggers [community contribution welcome]

Aperta
#153 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement suggested for community contribution
Lingua principale
Go
Stelle
13.6k
Fork
1.4k
Merge medio
2h 31m
PR unite (30g)
4

Descrizione

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 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!

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Leggi la logica di cut-over in go/logic/migrator.go, quindi traccia l’avvio della migrazione, entrambe le modalità di cut-over, waitForEventsUpToLock() e la gestione del rollback. Il lavoro è completato quando i trigger vengono letti all’avvio della migrazione, applicati alla tabella _ghost solo dopo che il backlog è stato smaltito e le tabelle sono sincronizzate, e rimossi prima che le scritture riprendano lì durante il rollback.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
go, mysql
Ambito
databases
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.