Skip to content

Commit

Permalink
go/vt/mysqlctl: add postflight_mysqld_start hook
Browse files Browse the repository at this point in the history
Signed-off-by: Max Englander <[email protected]>
  • Loading branch information
maxenglander committed Jan 29, 2025
1 parent f2fed30 commit 3a9089a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions go/vt/mysqlctl/mysqld.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,15 @@ func (mysqld *Mysqld) startNoWait(cnf *Mycnf, mysqldArgs ...string) error {
return fmt.Errorf("mysqld_start hook failed: %v", hr.String())
}

// try the postflight mysqld start hook, if any
switch hr := hook.NewHook("postflight_mysqld_start", mysqldArgs).Execute(); hr.ExitStatus {
case hook.HOOK_SUCCESS, hook.HOOK_DOES_NOT_EXIST:
// hook exists and worked, or does not exist, we can keep going
default:
// hook failed, we report error
return fmt.Errorf("postflight_mysqld_start hook failed: %v", hr.String())
}

return nil
}

Expand Down

0 comments on commit 3a9089a

Please sign in to comment.