mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 07:06:30 +00:00
In some circumstances, e.g. while performing a switchover, it is essential
that repmgrd does not take any kind of failover action, as this will put
the cluster into an incorrect state.
Previously it was necessary to stop repmgrd on all nodes (or at least
those nodes which repmgrd would consider as promotion candidates), however
this is a cumbersome and potentially risk-prone operation, particularly if the
replication cluster contains more than a couple of servers.
To prevent this issue from occurring, this patch introduces the ability
to "pause" repmgrd on all nodes wth a single command ("repmgr daemon pause")
which notifies repmgrd not to take any failover action until the node
is "unpaused" ("repmgr daemon unpause").
"repmgr daemon status" provides an overview of each node and whether repmgrd
is running, and if so whether it is paused.
"repmgr standby switchover" has been modified to automatically pause repmgrd
while carrying out the switchover.
See documentation for further details.
35 lines
799 B
C
35 lines
799 B
C
/*
|
|
* repmgrd.h
|
|
* Copyright (c) 2ndQuadrant, 2010-2018
|
|
*/
|
|
|
|
|
|
#ifndef _REPMGRD_H_
|
|
#define _REPMGRD_H_
|
|
|
|
#include <time.h>
|
|
#include "portability/instr_time.h"
|
|
|
|
#define OPT_NO_PID_FILE 1000
|
|
|
|
extern volatile sig_atomic_t got_SIGHUP;
|
|
extern MonitoringState monitoring_state;
|
|
extern instr_time degraded_monitoring_start;
|
|
|
|
extern t_configuration_options config_file_options;
|
|
extern t_node_info local_node_info;
|
|
extern PGconn *local_conn;
|
|
extern bool startup_event_logged;
|
|
extern char pid_file[MAXPGPATH];
|
|
|
|
void try_reconnect(PGconn **conn, t_node_info *node_info);
|
|
|
|
int calculate_elapsed(instr_time start_time);
|
|
const char *print_monitoring_state(MonitoringState monitoring_state);
|
|
|
|
void update_registration(PGconn *conn);
|
|
void terminate(int retval);
|
|
|
|
|
|
#endif /* _REPMGRD_H_ */
|