added on-resurrecting hook
This commit is contained in:
parent
7dfb740519
commit
0e8e5de7aa
@ -38,6 +38,7 @@ The full list of supported hooks is best found in code: [hooks.go](https://githu
|
||||
|
||||
- `gh-ost-on-startup`
|
||||
- `gh-ost-on-validated`
|
||||
- `gh-ost-on-resurrecting`
|
||||
- `gh-ost-on-rowcount-complete`
|
||||
- `gh-ost-on-before-row-copy`
|
||||
- `gh-ost-on-status`
|
||||
|
@ -20,6 +20,7 @@ import (
|
||||
const (
|
||||
onStartup = "gh-ost-on-startup"
|
||||
onValidated = "gh-ost-on-validated"
|
||||
onResurrecting = "gh-ost-on-resurrecting"
|
||||
onRowCountComplete = "gh-ost-on-rowcount-complete"
|
||||
onBeforeRowCopy = "gh-ost-on-before-row-copy"
|
||||
onRowCopyComplete = "gh-ost-on-row-copy-complete"
|
||||
@ -112,6 +113,10 @@ func (this *HooksExecutor) onValidated() error {
|
||||
return this.executeHooks(onValidated)
|
||||
}
|
||||
|
||||
func (this *HooksExecutor) onResurrecting() error {
|
||||
return this.executeHooks(onResurrecting)
|
||||
}
|
||||
|
||||
func (this *HooksExecutor) onRowCountComplete() error {
|
||||
return this.executeHooks(onRowCountComplete)
|
||||
}
|
||||
|
@ -303,6 +303,10 @@ func (this *Migrator) applyResurrectedContext() error {
|
||||
this.migrationContext.ApplyResurrectedContext(this.resurrectedContext)
|
||||
atomic.StoreInt64(&this.migrationContext.IsResurrected, 1)
|
||||
|
||||
if err := this.hooksExecutor.onResurrecting(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
5
resources/hooks-sample/gh-ost-on-resurrecting-hook
Normal file
5
resources/hooks-sample/gh-ost-on-resurrecting-hook
Normal file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Sample hook file for gh-ost-on-resurrecting
|
||||
|
||||
echo "$(date) gh-ost-on-resurrecting: beginning resurrection on $GH_OST_DATABASE_NAME.$GH_OST_TABLE_NAME" >> /tmp/gh-ost.log
|
Loading…
Reference in New Issue
Block a user