Commit Graph

52 Commits

Author SHA1 Message Date
Ian Barwick
3f872cde0c "repmgr node ...": fixes for 9.3
Mainly to account for the lack of replication slots.
2017-11-16 11:26:39 +09:00
Ian Barwick
c5d91ca88c repmgr node rejoin: add --dry-run option 2017-10-26 09:42:12 +09:00
Ian Barwick
a9759cf6ca Add --help output for "repmgr node service"
Addresses GitHub #329.
2017-10-20 16:49:29 +09:00
Ian Barwick
6852ac82c6 Add --help output for "repmgr node rejoin"
Addresses GitHub #329.
2017-10-20 16:49:19 +09:00
Ian Barwick
5045e2eb9d node rewind: add check for pg_rewind and --dry-run mode
Addresses GitHub #330
2017-10-20 14:16:56 +09:00
Ian Barwick
20224d1296 Prevent compiler truncation warnings 2017-09-19 16:24:01 +09:00
Ian Barwick
e64600d3e3 Prevent compiler truncation warnings 2017-09-19 16:15:47 +09:00
Ian Barwick
e3defc507e Merge branch 'pg93' 2017-09-18 15:55:32 +09:00
Ian Barwick
30b11c08e6 Disable any configuration settings not compatible with PostgreSQL 9.3
And emit a warning while we're at it.
2017-09-18 13:12:38 +09:00
Ian Barwick
68f4a37ca4 Update README 2017-09-14 08:57:16 +09:00
Ian Barwick
a9f4a027a7 pgindent run 2017-09-11 11:14:13 +09:00
Ian Barwick
64ec85bb10 Clarify _do_node_archive_config() usage 2017-09-11 11:00:13 +09:00
Ian Barwick
e4f7dc8234 Add copyright notices 2017-09-08 13:27:39 +09:00
Ian Barwick
edee80cc37 Rename option "node check --is-shutdown" to "--is-shutdown-cleanly"
As that's what we really want to know. Also return "UNCLEAN_SHUTDOWN"
if that's the case, rather than "RUNNING" which is confusing, even
though it's a command for internal use.
2017-09-07 11:15:27 +09:00
Ian Barwick
5b5b456ecb "standby switchover": improve logging
Also no need to disconnect/reconnect from/to local node while it promotes.
2017-09-05 10:26:27 +09:00
Ian Barwick
edb74ccef9 Various fixes to "repmgr node rejoin" 2017-09-01 11:30:31 +09:00
Ian Barwick
ac64526bd3 Finalize "repmgr node --help" output 2017-08-17 14:25:43 +09:00
Ian Barwick
9ac5c48cc5 Add --help output for "repmgr node check" 2017-08-17 14:12:40 +09:00
Ian Barwick
5127b9253b "repmgr node check": improve Nagios output 2017-08-17 13:54:48 +09:00
Ian Barwick
b1ba476241 Rename "archiver" check etc. to "archive-ready"
Gives a better indication of what's being checked.
2017-08-17 12:23:56 +09:00
Ian Barwick
b1b5870d54 "repmgr node status": add --help output, fix CSV output
Also ensure is executed only on local node, as it needs to read
the data directory.
2017-08-17 11:27:31 +09:00
Ian Barwick
0ac16f7630 Add more --help output 2017-08-16 17:49:46 +09:00
Ian Barwick
4efc8fb9ce Add placeholder functions for "repmgr $command --help"
There are now too many options to sensibly fit into general --help
output; we'll add separate output for each repmgr command, e.g.
"repmgr node --help".
2017-08-16 13:24:14 +09:00
Ian Barwick
4c0d719cdb Add replication slot check to "repmgr node check" 2017-08-16 11:17:02 +09:00
Ian Barwick
3e9ce6fe38 Fix "repmgr node check --role" output 2017-08-15 22:07:07 +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
fa7d60cd51 "node check": initial general output 2017-08-14 17:32:44 +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
50b82f785e Add function to execute "IDENTIFY_SYSTEM" 2017-08-11 22:01:02 +09:00
Ian Barwick
f972aec198 Parse recovery.conf file
This will be useful for various kinds of diagnostics.
2017-08-10 23:58:16 +09:00
Ian Barwick
8a50a72dc5 Additional "node status" output 2017-08-10 17:18:08 +09:00
Ian Barwick
a57fb5b50c After switchover, enable sibling standbys to follow new primary 2017-08-10 00:06:16 +09:00
Ian Barwick
4930c95ef7 Consolidate final output of "standby follow" / "node rejoin" 2017-08-09 19:31:42 +09:00
Ian Barwick
bae82318f1 No need to expose configuration file archive functions as repmgr commands 2017-08-09 13:32:15 +09:00
Ian Barwick
df425a38b7 Refactor "standby follow" functionality
"standby follow" was originally co-opted to start up a demoted node;
this functionality is now delegated to "node rejoin", with the core
functionality of "standby follow" implemented as an internal function.
2017-08-09 13:26:27 +09:00
Ian Barwick
b1e544f962 Enable use of pg_rewind during switchover operations
But only if required and --force-rewind required, and pg_rewind
can actually be used.
2017-08-09 12:09:37 +09:00
Ian Barwick
f2cf46bba3 Check replication lag before attempting switchover 2017-08-08 10:16:47 +09:00
Ian Barwick
2499b42ef8 switchover: check for pending archive files on the demotion candidate
If the current primary (demotion candidate) still has any files to archive,
it will delay the shutdown until all files are archived. If there is a
substantial number of files, and/or the archive command executes slowly,
this will probably lead to an unwelcome delay in the switchover process.
2017-08-08 00:37:20 +09:00
Ian Barwick
112ca6321a Initial switchover implementation
The repmgr3 implementation required the promotion candidate (standby)
to directly work with the demotion candidate's data directory,
directly execute server control commands etc.

Here we delegated a lot more of that work to the repmgr on the
demotion candidate, which reduces the amount of back-and-forth
over SSH and generally makes things cleaner and smoother.

In particular the repmgr on the demotion candidate will carry
out a thorough check that the node is shut down and report
the last checkpoint LSN to the promotion candidate; this
can then be used to determine whether pg_rewind needs to be
executed on the demoted primary before reintegrating it back
into the cluster (todo).

Also implement "--dry-run" for this action, which will sanity-check the
nodes as far as possible without executing the switchover.

Additionally some of the new repmgr node commands (or command options)
introduced for this can be also executed by the user to obtain
additional information about the status of each node.
2017-08-03 16:38:37 +09:00
Ian Barwick
83cda89362 Get data directory for server commands if needed
Also add configuration file option "pgdata" for hard-coding the
node's data directory - if the "repmgr" DB user isn't a superuser
or doesn't have permission to extract the data directory, we'll
need another way of finding out.
2017-08-02 13:16:16 +09:00
Ian Barwick
aa528dfdfb Consolidate generation of various server control commands
This is needed for better switchover control, so we can instruct
the remote repmgr to issue the appropriate server command rather
than trying to work out what it should be from the local node.
2017-08-02 12:01:20 +09:00
Ian Barwick
a1ad62d04e Add "repmgr node restore-config" 2017-08-01 22:13:32 +09:00
Ian Barwick
f023b9c90c Add "repmgr node archive-config" 2017-08-01 17:38:54 +09:00
Ian Barwick
8a5665a421 repmgr node status: add information about current LSN locations for streaming standbys 2017-08-01 10:34:12 +09:00
Ian Barwick
dc24d62009 repmgrd: improve BDR recovery handling 2017-07-27 11:53:55 +09:00
Ian Barwick
c3083a0ba0 repmgr node status: add "raw" data columns too 2017-07-25 12:06:42 +09:00
Ian Barwick
2a08317984 repmgr node status: optional CSV output 2017-07-25 11:26:09 +09:00