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

Follow primary command not triggered following a successful primary node failover #65

Open
lukaszdobrzynski opened this issue Aug 14, 2024 · 1 comment
Assignees

Comments

@lukaszdobrzynski
Copy link

According to the docs follow_primary_command specifies a user command to run after failover on the primary node failover. Typically follow_primary_command is used to recover the standby from the new primary.
While failover_command works perfectly well and runs a script to promote the standby node to a new primary, the follow_primary_command is not triggered after the successful promotion, which is something I'd expect to happen next.

The pgpool.conf setup contains the following entries:

backend_clustermode = 'streaming_replication'
failover_command = '/var/pgpool-failover.sh %d %h %p %D %m %M %H %P '
follow_primary_command = '/var/pgpool-follow-primary.sh %d %h %p %D %m %H %M %P %r %R '

The pgpool-failover.sh script does the following:

ssh postgres@$new_master_host_name 'repmgr -f /etc/repmgr.conf standby promote'

The pgpool-follow-primary.sh is expected to create a log entry for testing purposes, yet no entry is created in the system, so I assume the command is not invoked by the pgpool:

touch /var/follow-primary-log && echo "Follow  primary command triggered!" >> /var/follow-primary-log

Is there anything I might be missing here or do not understand about follow_primary_command option?

@pengbo0328 pengbo0328 self-assigned this Aug 18, 2024
@pengbo0328
Copy link
Collaborator

@lukaszdobrzynski Pgpool will execute follow_primary_command on all nodes except the new primary.

Did you see the following log in pgpool log?

=== Starting follow primary command for node X ===
LOG:  execute command: /path/to/follow_primary.sh ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants