Ian Barwick
375a96a5c8
repmgrd: log execution error in "repmgrd_get_local_node_id()"
...
That shouldn't happen, but if it does it will make it easier to
identify the issue.
2018-01-16 11:16:19 +09:00
Ian Barwick
8fd0c4ad83
repmgr: assume node is actually shutting down if pingable and that's the reported status
2018-01-12 21:53:37 +09:00
Ian Barwick
7ccae6c2b1
repmgr: automatically create slot name if missing
...
It's possible that a node was registered with "use_replication_slots=false"
but that was later changed to "use_replication_slots=true". If the node
was not subsequently re-registered, the node record will contain an empty
slot name, which will cause any slot creation operation during
"standby follow" or "node rejoin" to fail.
To prevent this happening, check for an empty slot name and automatically
set before proceeding.
Addresses GitHub #343 .
2018-01-11 14:47:50 +09:00
Ian Barwick
61d46172b9
repmgr: catch possible corner case when checking node shutdown status
...
It's conceivable that PQping is returning "no response" but the
shutdown hasn't quite completed.
2018-01-10 15:09:21 +09:00
Ian Barwick
810471b2f2
repmgr: during switchover, correctly detect unclean shutdown status
2018-01-10 12:25:16 +09:00
Ian Barwick
5bd8cf958a
repmgr standby switchover: add "%p" event notification parameter
...
This will contain the node ID of the former primary.
2018-01-10 12:25:12 +09:00
Ian Barwick
fcb7e7a29b
"repmgr bdr register": create missing connection replication set if needed
...
Previously the assumption was that the "repmgr" replication set would be
set up when the nodes are created, however no checks were implemented
and this was not well-documented.
Addresses GitHub #347 .
2018-01-04 17:46:49 +09:00
Ian Barwick
26e404b1f3
"repmgr bdr register": improve node name check
...
We'll use "bdr.bdr_get_local_node_name()" to check the local BDR node
name and the repmgr one match.
2018-01-04 17:46:44 +09:00
Ian Barwick
841f03aeba
Fix query in is_active_bdr_node()
...
Boolean column was not being checked correctly.
Also add detail output in "repmgr node role --check", where the function
is called.
2018-01-04 14:55:51 +09:00
Ian Barwick
cad12b1fb7
"repmgr cluster event": move query to dbutils.c
2018-01-04 14:55:46 +09:00
Ian Barwick
26a9e848fd
Update copyright notices to 2018
2018-01-02 10:19:46 +09:00
Ian Barwick
8c121da8a1
Add diagnostic option "repmgr node check --has-passfile"
...
This checks if the active libpq version (9.6 and later) has the
"passfile" option, and returns 0 if present, 1 if not.
`
2017-12-11 20:09:48 +09:00
Ian Barwick
472d703d2e
repmgr: initialise "voting_term" in "repmgr primary register"
...
This previously happened in the extension SQL code, which could
potentially cause replay problems if installing on a BDR cluster.
As this table is only required for streaming replication failover,
move the initialisation to "repmgr primary register".
Addresses GitHub #344 .
2017-11-28 11:08:12 +09:00
Ian Barwick
81beec54aa
repmgr: fix return code output for repmgr node check --action=...
...
Addresses GitHub #340
2017-11-23 10:34:21 +09:00
Martín Marqués
2e42226f68
Fix missing FQN for the nodes table.
...
This bug was not detected before because most users work with the repmgr
user. For that reason, the repmgr schema is already in the search_path
by default.
Add the repmgr schema to the nodes table in the LEFT JOIN used for
cluster show (and in other places)
Signed-off-by: Martín Marqués <martin.marques@2ndquadrant.com >
2017-11-22 17:13:58 -03:00
Ian Barwick
8c422d6084
Remove unneeded functions
2017-11-20 15:18:21 +09:00
Ian Barwick
9165d27f9f
"repmgr node ...": fixes for 9.3
...
Mainly to account for the lack of replication slots.
2017-11-16 11:25:16 +09:00
Ian Barwick
b8b991398a
Escape double-quotes in strings passed to an event notification script
...
The string in question will be generated internally by repmgr as a simple
one-line string with no control characters etc., so all that needs to be
escaped at the moment are any double quotes.
2017-11-16 10:36:48 +09:00
Ian Barwick
9d432546bf
repmgrd: don't fail over unless more than 50% of active nodes are visible.
2017-11-15 13:48:28 +09:00
Ian Barwick
022d9c58c2
Add "witness unregister" functionality
2017-11-15 13:47:48 +09:00
Ian Barwick
a6cc4d80f0
Add "witness register" functionality
2017-11-15 13:47:45 +09:00
Ian Barwick
eb14bb58c6
Add configuration file "passfile"
...
This will enable a custom .pgpass to be included in "primary_conninfo"
(provided it's supported by the libpq version on the standby).
2017-11-14 19:30:25 +09:00
Ian Barwick
aa089820ab
repmgrd: check shared library is loaded
...
If this isn't the case, "repmgrd" will appear to run but not handle
failover correctly.
Address GitHub #337 .
2017-11-10 14:35:17 +09:00
Ian Barwick
4ca7e6a6bf
repmgrd: remove unneeded functions
2017-11-09 19:31:08 +09:00
Ian Barwick
79d21b516b
repmgrd: fixes to failover handling
...
get_new_primary() returns NULL if no notification for the new primary has
been received, but the code was expecting it to return UNKNOWN_NODE_ID,
which was causing repmgrd to prematurely drop out of the new primary
detection loop if no notification had been received by the time the loop
started.
Also store the electoral term as a single row, single column table,
to ensure that all repmgrds see the same turn. It is then bumped
by the winning node after it gets promoted.
Various logging improvements.
2017-11-08 14:28:08 +09:00
Ian Barwick
d6c27f8938
Standardize quoting in log messages
2017-10-04 09:34:59 +09:00
Ian Barwick
31c7cb4e9a
Fixes for 9.3 support
2017-09-15 17:13:17 +09:00
Ian Barwick
b6b31b15b2
Implement "repmgr cluster cleanup"
2017-09-11 13:48:46 +09:00
Ian Barwick
a9f4a027a7
pgindent run
2017-09-11 11:14:13 +09:00
Ian Barwick
e4f7dc8234
Add copyright notices
2017-09-08 13:27:39 +09:00
Ian Barwick
a28bbd68eb
"standby clone": improve replication slots handling
...
Ensure replication slot is created on the upstream node and deleted from
the source node, if upstream node and source nodes differ.
2017-09-06 12:16:02 +09:00
Ian Barwick
bd07a34472
"standby clone": improve log messages
...
Make it clearer which nodes are being connected to, and why.
2017-09-06 10:15:52 +09:00
Ian Barwick
1ef00f5a3b
repmgrd: parse "follow_command" during cascaded standby failover
2017-09-05 11:19:25 +09:00
Ian Barwick
78e6bdeebe
Have repmgrd parse "standby follow --upstream-node-id=%n"
2017-09-04 13:42:50 +09:00
Ian Barwick
9a0f45d7d3
Standardize quotation marks in log messages
2017-09-04 10:56:57 +09:00
Ian Barwick
1445d1002c
Clean up log messages
...
Remove legacy trailing new lines.
2017-09-04 10:52:42 +09:00
Ian Barwick
ed16c32fe7
Check minimum server version for pg_rewind
2017-08-31 13:30:59 +09:00
Ian Barwick
fcd111ac4c
Improve logging output during failover process
2017-08-24 22:44:03 +09:00
Ian Barwick
eee8d65259
Update view "replication_status"
2017-08-24 15:05:13 +09:00
Ian Barwick
a659132ea4
repmgrd: write monitoring statistics
2017-08-24 11:49:44 +09:00
Ian Barwick
a0bad5fdc0
General code cleanup
2017-08-16 23:09:02 +09:00
Ian Barwick
8ff545f9ae
Add --help output for "repmgr cluster"
2017-08-16 16:33:07 +09:00
Ian Barwick
4c0d719cdb
Add replication slot check to "repmgr node check"
2017-08-16 11:17:02 +09:00
Ian Barwick
554673e83e
Add "repmgr node check --downstream"
2017-08-15 15:50:46 +09:00
Ian Barwick
10ef30096c
"node check": add server role check
2017-08-14 22:57:09 +09:00
Ian Barwick
3b2158edbf
Initialise variables, where appropriate
2017-08-14 15:11:42 +09:00
Ian Barwick
eabd56f3be
"standby follow": check node system identifiers match
2017-08-14 11:45:08 +09:00
Ian Barwick
0f31756733
General code cleanup
2017-08-14 10:04:53 +09:00
Ian Barwick
b95b3e50e3
Return system identification information with appropriate data types
2017-08-14 08:50:54 +09:00
Ian Barwick
50b82f785e
Add function to execute "IDENTIFY_SYSTEM"
2017-08-11 22:01:02 +09:00