Commit Graph

160 Commits

Author SHA1 Message Date
Ian Barwick
ff4cc64a67 repmgrd: refresh upstream node record from upstream itself 2017-07-05 13:23:42 +09:00
Ian Barwick
3c45853b6f Fixes for cascaded standby failover 2017-07-05 12:43:35 +09:00
Ian Barwick
a31d66f826 repmgr standby follow: add event details
Useful to have a confirmation of which node was followed.
2017-07-05 11:36:30 +09:00
Ian Barwick
2f2a983272 Fixes for cascaded standby monitoring 2017-07-05 11:26:09 +09:00
Ian Barwick
614287548d Fix function get_primary_node_record() 2017-07-05 11:20:32 +09:00
Ian Barwick
617dee6bd6 Add function create_event_record()
For logging an event to the event table without generating an external
event notification.

Rename existing create_event_record*() functions to create_event_notification*()
as this describes their function better.
2017-07-05 09:52:22 +09:00
Ian Barwick
d3ec15cd25 Fixes from merge 2017-07-04 23:57:43 +09:00
Ian Barwick
582d0ef363 Rename "logxxx" configuration file parameters to "log_xxx"
This is more consistent with other parameters and conforms to
the pattern used by PostgreSQL itself, which uses the prefix "log_"
for logging parameters.

A warning will be emitted if the old version of the parameter name
is detected.
2017-07-04 23:36:47 +09:00
Ian Barwick
9bf264177f Add checks for use of --upstream-node-id 2017-07-04 23:35:19 +09:00
Ian Barwick
60edb00bb4 Add dummy BDR monitoring handler 2017-07-04 23:35:19 +09:00
Ian Barwick
4e06355b57 Replace repmgr.conf item "upstream_node_id" with --upstream-node-id
This is only relevant when cloning a standby and the node's upstream
can change after failover/switchover etc., so no point keeping the
original value around in the configuration file.
2017-07-04 23:34:20 +09:00
Ian Barwick
24c6b2c9f1 repmgrd: initial code for cascaded standby failover 2017-07-04 23:14:05 +09:00
Ian Barwick
e1f4384f7e repmgrd: refactory primary failover code into separate function 2017-07-04 20:42:22 +09:00
Ian Barwick
f7f49ae85e repmgrd: handle case where upstream node ID is not defined
This shouldn't usually happen, but can't be ruled out entirely.
2017-07-04 18:05:35 +09:00
Ian Barwick
7bd8ce703d repmgrd: handle local node outage 2017-07-04 13:22:26 +09:00
Ian Barwick
618a2346e1 repmgrd: various fixed, mainly clearing status after a failover event 2017-07-04 11:55:03 +09:00
Ian Barwick
78d45ebf68 Various fixes
Add more event logging, and improve comments.
2017-07-03 23:41:34 +09:00
Ian Barwick
c2d615fc19 repmgrd: only vote for self if no other node is ahead 2017-07-03 21:59:34 +09:00
Ian Barwick
c12bf01b5a When clearing a node info list, reset the node count to 0 2017-07-03 21:59:02 +09:00
Ian Barwick
cc46058a8e repmgrd: ensure standby_nodes list is up-to-date 2017-07-03 20:22:48 +09:00
Ian Barwick
890b88d644 More failover fixes 2017-07-03 17:37:32 +09:00
Ian Barwick
1bc4e968f6 Localize variables 2017-07-03 14:57:39 +09:00
Ian Barwick
e3d52d1257 repmgrd: execute "standby follow" 2017-07-03 14:36:55 +09:00
Ian Barwick
18b40be7f1 Add configuration option "log_status_interval"
Normally (outside of log level DEBUG) repmgrd doesn't generate any
kind of log output, so examining the log file may give the impression
it's not working. Output an informational message at regular intervals
to show it's up and running.
2017-07-03 12:14:52 +09:00
Ian Barwick
34c746fcde Rename "logxxx" configuration file parameters to "log_xxx"
This is more consistent with other parameters and conforms to
the pattern used by PostgreSQL itself, which uses the prefix "log_"
for logging parameters.

A warning will be emitted if the old version of the parameter name
is detected.
2017-07-03 10:38:15 +09:00
Ian Barwick
debe5a18c5 have new primary communicate to standbys 2017-06-30 21:45:25 +09:00
Ian Barwick
1857e23fef add failover states 2017-06-30 17:42:39 +09:00
Ian Barwick
83405a6d39 Add sample configuration file
Formatted more like the default postgresql.conf file for clarity.
2017-06-30 17:14:06 +09:00
Ian Barwick
c793b1b7d2 repmgr: fix generation of default "dbname"
If not explicitly provided, "dbname" was being set early to the default
"username" value, which was leading to different behaviour to libpq
applications, where "dbname" defaults to "username" at connection
time.
2017-06-30 17:13:59 +09:00
Ian Barwick
a666a49977 Execute promote command 2017-06-30 16:04:47 +09:00
Ian Barwick
9caa715eb0 minor fixes 2017-06-30 14:30:41 +09:00
Ian Barwick
fc4f276844 Improve handling
not sure if we need to store the electoral term...
2017-06-30 13:40:19 +09:00
Ian Barwick
3514e20367 poke it around until it works less badly 2017-06-29 09:35:09 +09:00
Ian Barwick
fa86fe4ad8 Basic voting 2017-06-29 01:11:21 +09:00
Ian Barwick
d6b6255144 interim commit 2017-06-28 18:20:03 +09:00
Ian Barwick
f4e8bf891d interim commit 2017-06-28 17:28:26 +09:00
Ian Barwick
ded8d95e5a interim commit 2017-06-28 16:38:41 +09:00
Ian Barwick
35b6178e07 placeholder code for function 2017-06-27 09:50:47 +09:00
Ian Barwick
78a16d746d Initial primary node monitoring 2017-06-27 00:15:29 +09:00
Ian Barwick
7845a1fb47 Minimum supported version is currently 9.4 2017-06-25 21:46:50 +09:00
Ian Barwick
b64581c582 repmgrd: log startup on primary 2017-06-24 08:44:19 +09:00
Ian Barwick
27ad7b4f79 repmgrd: add stdout/stderr redirects 2017-06-23 22:41:58 +09:00
Ian Barwick
8117d4dcc4 Various minor fixes 2017-06-23 21:42:28 +09:00
Ian Barwick
46c956e61a Use "primary" instead of "master" 2017-06-23 21:33:54 +09:00
Ian Barwick
28808a02ab Fix return value of _get_node_record() 2017-06-23 20:44:40 +09:00
Ian Barwick
9566dc49f3 repmgrd: sanity check for presence of follow/promote commands
Autofailover will fail if either is missing.
2017-06-23 18:54:45 +09:00
Gianni Ciolli
71146aef9d Removing repmgr executable 2017-06-23 09:47:26 +01:00
Ian Barwick
1b2652037d Rename enum types for consistency 2017-06-23 16:38:14 +09:00
Ian Barwick
dbaa2e0b44 Add a RecordStatus return type for functions which populate record structures
Unify a bunch of slightly different ways of handling the result.
2017-06-23 16:16:46 +09:00
Ian Barwick
0823a83f92 Handle some deprecated command line options 2017-06-23 14:18:17 +09:00