This allows users of pg_auto_failover to setup their own scripts/actions to complement a failover. The hooks are run in a process that is separate from the main FSM, so as to prevent the system from making progress.
As a result, it's not possible for the hooks to change how things are implemented in pg_auto_failover itself.
The hook system also allows running a user-defined "service", which is a long running process or a deamon that belongs to pg_autoctl process tree.
[x] Implement a new internal service for running user-defined hooks
[ ] Implement pg_autoctl enable|disable run-hooks
[ ] Implement pg_autoctl create listener
[ ] Implement support for running script/commands (man system)
[ ] Add unit testing support for user-defined hooks
[ ] Document the new hook system, including tutorial
[ ] Add documentation examples covering pgbouncer as a hooked system
This allows users of pg_auto_failover to setup their own scripts/actions to complement a failover. The hooks are run in a process that is separate from the main FSM, so as to prevent the system from making progress.
As a result, it's not possible for the hooks to change how things are implemented in pg_auto_failover itself.
The hook system also allows running a user-defined "service", which is a long running process or a deamon that belongs to pg_autoctl process tree.
Fixes #878. Closes #573. Closes #539. Closes #508. Fixes #490. Fixes #440. Fixes #427.