<div dir="ltr">Hi all,<div><br></div><div>I'm busy upgrading to postgres 13 and pgpool 4.1.4, and as part of that reworking some of our scripts and improving some of our operational procedures.</div><div><br></div><div>I'd like to have a way to promote a specific backend to primary, and have the old primary use pg_rewind, then connect to the new primary.</div><div><br></div><div>I'm using scripts largely based on the samples, though without pg_basebackup as a fallback to pg_rewind - our thinking is if pg_rewind fails, we want to leave it in the current state and investigate, then restore manually.</div><div><br></div><div>I can run pcp_detach_node to almost achieve this controlled primary failover, but it doesn't let me specify which primary to fail over to.</div><div>pcp_promote_node explicitly says it's only about internal pgpool state, and it runs follow_master_command, but not failover_command.</div><div><br></div><div>Is there a way to achieve this in pgpool at the moment? If not, could we put together a new feature / command to achieve this? (Happy to contribute code, if this is something that would be useful).</div><div>Thinking:</div><div>1) Detach old primary</div><div>2) Run failover_command on the new primary</div><div>3) Run follow_master_command on the standbys (including the old primary, which gets reattached by the script)</div><div><br></div><div>Perhaps this is an extra flag on pcp_promote_node which causes failover_command to run?</div><div><br></div><div>--</div><div>Nathan Ward</div><div><br></div></div>