mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 00:46:29 +00:00
repmgrd: optionally disconnect WAL receivers during failover
This is intended to ensure that all nodes have a constant LSN while making the failover decision. This feature is experimental and needs to be explicitly enabled with the configuration file option "standby_disconnect_on_failover". Note enabling this option will result in a delay in the failover decision until the WAL receiver is disconnected on all nodes.
This commit is contained in:
@@ -2681,6 +2681,39 @@ do_node_rejoin(void)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Currently for testing purposes only, not documented;
|
||||
* use at own risk!
|
||||
*/
|
||||
|
||||
void
|
||||
do_node_control(void)
|
||||
{
|
||||
PGconn *conn = NULL;
|
||||
pid_t wal_receiver_pid = UNKNOWN_PID;
|
||||
conn = establish_db_connection(config_file_options.conninfo, true);
|
||||
|
||||
if (runtime_options.disable_wal_receiver == true)
|
||||
{
|
||||
wal_receiver_pid = disable_wal_receiver(conn);
|
||||
|
||||
PQfinish(conn);
|
||||
|
||||
if (wal_receiver_pid == UNKNOWN_PID)
|
||||
exit(ERR_BAD_CONFIG);
|
||||
|
||||
exit(SUCCESS);
|
||||
}
|
||||
|
||||
if (runtime_options.enable_wal_receiver == true)
|
||||
{
|
||||
wal_receiver_pid = enable_wal_receiver(conn);
|
||||
}
|
||||
|
||||
PQfinish(conn);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* For "internal" use by `node rejoin` on the local node when
|
||||
* called by "standby switchover" from the remote node.
|
||||
|
||||
Reference in New Issue
Block a user