mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56: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:
16
repmgr.c
16
repmgr.c
@@ -147,6 +147,8 @@ PG_FUNCTION_INFO_V1(repmgrd_pause);
|
||||
Datum repmgrd_is_paused(PG_FUNCTION_ARGS);
|
||||
PG_FUNCTION_INFO_V1(repmgrd_is_paused);
|
||||
|
||||
Datum get_wal_receiver_pid(PG_FUNCTION_ARGS);
|
||||
PG_FUNCTION_INFO_V1(get_wal_receiver_pid);
|
||||
|
||||
|
||||
/*
|
||||
@@ -740,3 +742,17 @@ repmgrd_is_paused(PG_FUNCTION_ARGS)
|
||||
|
||||
PG_RETURN_BOOL(is_paused);
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
get_wal_receiver_pid(PG_FUNCTION_ARGS)
|
||||
{
|
||||
int wal_receiver_pid;
|
||||
|
||||
if (!shared_state)
|
||||
PG_RETURN_NULL();
|
||||
|
||||
wal_receiver_pid = WalRcv->pid;
|
||||
|
||||
PG_RETURN_INT32(wal_receiver_pid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user