Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{WIP} Implement on_primary hooks. #958

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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