Ian Barwick
7cf3b9b618
repmgrd: improve logging of BDR monitoring
...
Also always log information about event_notification command
2017-07-27 21:12:41 +09:00
Ian Barwick
fed6fba4ef
repmgrd: more fixes for BDR node recovery
2017-07-27 14:13:39 +09:00
Ian Barwick
0dcd479322
Store node status in node record struct
2017-07-17 13:50:17 +09:00
Ian Barwick
ec00202a31
Add configure option --with-bdr-only
...
Builds repmgr with only BDR functionality; other code is disabled
at critical points.
2017-07-16 17:18:34 +09:00
Ian Barwick
a29bc3e0fa
Rename config.[ch] to configfile.[ch]
2017-07-16 09:41:26 +09:00
Ian Barwick
951c7dbd07
repmgrd: in BDR mode, have each repmgrd monitor each node
...
This will cover both the case when an entire node including
repmgrd goes down, and when one PostgreSQL instance goes down
but repmgrd is still up (in which case only one of the repmgrds
will handle the failover).
2017-07-14 15:01:18 +09:00
Ian Barwick
e3b3fb65f0
repmgrd: restrict BDR monitoring to two node setup
...
It's not safe to have more than two nodes with this kind of
"failover", so we don't need to select alternative nodes by
priority.
2017-07-14 12:56:11 +09:00
Ian Barwick
d653888c65
Support pre-10 WAL functions
2017-07-14 10:40:11 +09:00
Ian Barwick
d77e8d4d22
repmgrd: split physical and BDR functionality into separate files
2017-07-13 17:21:29 +09:00
Ian Barwick
2962ffe605
repmgrd: initial BDR monitoring support
2017-07-10 23:58:59 +09:00
Ian Barwick
941ed343f8
repmgrd: additional location check
...
If only one promotion candidate is available, check it is in the
same location as the primary.
2017-07-10 15:20:43 +09:00
Ian Barwick
5fbcf3e476
Remove witness server references
2017-07-10 09:31:31 +09:00
Ian Barwick
9e3d942917
Handle various (unlikely) failure states
2017-07-10 09:00:18 +09:00
Ian Barwick
5bf7098139
repmgrd: consolidate clear_node_info_list() calls
2017-07-09 11:10:49 +09:00
Ian Barwick
2787994a6e
Make repmgrd failover settings configurable
2017-07-07 21:11:22 +09:00
Ian Barwick
35df85e67d
repmgrd: improve handling of "degraded monitoring"
...
In some cases, the monitored upstream may not be available for a while
(e.g. network split), in which case it makes sense to have repmgrd
keep running and trying to reconnect. Previously it would just keel
over and quit.
2017-07-06 17:19:55 +09:00
Ian Barwick
6b82ecbafc
repmgrd: check for visibility of primary location
...
Also support degraded monitoring status
2017-07-06 11:45:04 +09:00
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
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
60edb00bb4
Add dummy BDR monitoring handler
2017-07-04 23:35:19 +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
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
a666a49977
Execute promote command
2017-06-30 16:04:47 +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
78a16d746d
Initial primary node monitoring
2017-06-27 00:15:29 +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
46c956e61a
Use "primary" instead of "master"
2017-06-23 21:33:54 +09:00