Skip to content

Conversation

DimCitus
Copy link
Collaborator

@DimCitus DimCitus commented Oct 21, 2022

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.

  • 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

Fixes #878.
Closes #573.
Closes #539.
Closes #508.
Fixes #490.
Fixes #440.
Fixes #427.

@DimCitus DimCitus self-assigned this Oct 21, 2022
@DimCitus DimCitus added enhancement New feature or request user experience Size:M Effort Estimate: Medium labels Oct 21, 2022
@dimitri dimitri force-pushed the feature/on-primary-hooks branch from fe50811 to e82e3e1 Compare April 28, 2023 14:55
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
@dimitri dimitri force-pushed the feature/on-primary-hooks branch from e82e3e1 to 66c05b9 Compare April 28, 2023 14:57
@abubakarm94
Copy link

This feature will be extremely valuable. Any thoughts on when we can expect this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Size:M Effort Estimate: Medium user experience
Projects
None yet
2 participants