Commit Graph

155 Commits

Author SHA1 Message Date
Ian Barwick
c54045bcd8 "standby follow": initial implementation of --dry-run option
GitHub #363.
2018-02-01 14:18:40 +09:00
Ian Barwick
c11e92cf2a repmgr: improve switchover handling when "pg_ctl" used
If logging output not explicitly rediretced with "-l" in the pg_ctl
options, repmgr would hang waiting for pg_ctl output.

Note that we recommend using the OS-level service commands where
available.
2018-01-30 13:43:37 +09:00
Ian Barwick
6dc1969ad5 Remove --bdr-only configuration option
This was required for a specific use case during pre-release
development and is no longer needed now the physical streaming
replication handling is implemented.
2018-01-18 13:30:47 +09:00
Ian Barwick
ae7963dc64 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 11:13:41 +09:00
Ian Barwick
a608b0bc18 "repmgr standby register": add --wait-start option
Implements GitHub #356.
2018-01-04 12:48:12 +09:00
Ian Barwick
1521657965 Update copyright notices to 2018 2018-01-02 10:20:09 +09:00
Ian Barwick
407a7ea2f4 repmgr: add missing -W option to getopt_long() invocation
Addresses GitHub #350.
2017-12-20 10:28:31 +09:00
Ian Barwick
54a10a0c3f 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-05 12:53:04 +09:00
Ian Barwick
efe28cbbeb witness (un)register: add --dry-run mode 2017-11-15 14:04:09 +09:00
Ian Barwick
6131c1d8ce witness unregister: enable execution when witness server is down
Also add help output for "repmgr witness --help".
2017-11-15 14:04:06 +09:00
Ian Barwick
31b856dd9f Add "witness register" functionality 2017-11-15 14:03:54 +09:00
Ian Barwick
dff2bcc5de witness: initial code framework 2017-11-15 14:03:50 +09:00
Ian Barwick
fb0aae183d Docs: update "repmgr cluster show" 2017-10-26 09:42:36 +09:00
Ian Barwick
f58b102d51 Standardize terminology on "primary" (in place of "master") 2017-10-24 13:44:03 +09:00
Ian Barwick
90733aecf7 --dry-run available for "node rejoin" 2017-10-23 10:40:43 +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
f565851de3 repmgr client: clean up command line option handling 2017-10-04 09:35:04 +09:00
Ian Barwick
d6c27f8938 Standardize quoting in log messages 2017-10-04 09:34:59 +09:00
Ian Barwick
9a6580a312 If problems found with configuration file, show which file was read
But only if it wasn't explicitly specified with -f/--config-file.
2017-10-04 09:34:46 +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
ea2693bc75 Move create_recovery_file() et al to repmgr-action-standby.c
As they're only ever called from there.
2017-09-18 09:53:08 +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
0e6699ecb6 Formatting updates before pgindent run 2017-09-11 11:05:43 +09:00
Ian Barwick
e4f7dc8234 Add copyright notices 2017-09-08 13:27:39 +09:00
Ian Barwick
ab8cb9d471 "standby register": remove database connection parameter warning 2017-09-07 17:09:29 +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
03f400617c "standby register": add --dry-run and check node is attached to upstream 2017-09-06 15:48:23 +09:00
Ian Barwick
eeef0b5df5 Trim recovery.conf lines when outputting as debug log lines 2017-09-05 10:33:41 +09:00
Ian Barwick
47a4b49890 Add "repmgr standby follow --upstream-node-id"
In an automatic failover situation, after a standby has been promoted
there's a risk the original primary may become available again before
"standby follow" is issued on another standby node, in which case "standby
follow" will reconnect to the original primary.

As the standby's repmgrd will have received a notification from the new
primary, it will know the primary's ID and can therefore explicitly
direct "standby follow" to follow that primary.
2017-09-04 09:11:59 +09:00
Ian Barwick
c7423ebb44 Various minor fixes 2017-08-31 23:54:52 +09:00
Ian Barwick
91941183bc Use replication user, if set, when checking replication connections 2017-08-31 17:54:49 +09:00
Ian Barwick
04c9779561 Add documentation about passwords and recovery.conf 2017-08-31 15:24:09 +09:00
Ian Barwick
0e0b221507 Add configuration file setting "use_primary_conninfo_password"
If, for whatever reason, the upstream server password needs to be set
in "primary_conninfo", enable it to be extracted from $PGPASSWORD.
2017-08-31 14:57:07 +09:00
Ian Barwick
705b52fde4 Use actual program name rather than "repmgr" when executing remote commands
It's possible some distribution packages may assign a different name to the
"repmgr" binary (typically appending a version number), so we shouldn't hard-code
into the command string.

However it's reasonable to assume the "repmgr" binary will have the same name
across a replication cluster so we won't engage in any contortions to account
for possible variations.

See: https://github.com/2ndQuadrant/repmgr/issues/323
2017-08-31 11:04:11 +09:00
Ian Barwick
dfb796ca8f Check config file *before* checking command line parameters
Validity of command line parameters may depened on settings in the configuration
file.
2017-08-31 09:55:32 +09:00
Ian Barwick
8b03859dbe "standby clone": add early sanity check for external configuration files
This still requires an SSH connection, so we need to check early before
the cloning starts, and also emit useful information for --dry-run.
2017-08-29 22:11:16 +09:00
Ian Barwick
0b7dbb845c Add warning for --dry-run when not effective 2017-08-28 15:10:57 +09:00
Ian Barwick
754084c814 Update "repmgr standby --help" output 2017-08-26 10:27:22 +09:00
Ian Barwick
5ee1eb6bf7 Convert --recovery-min-apply-delay to configuration file option
That way it only needs to be set once, and won't get lost during
follow operations etc.
2017-08-25 21:25:15 +09:00
Ian Barwick
4921f389b6 Fix spurious warning when executing "repmgr node rejoin"
Database connection parameters required for this.
2017-08-25 16:28:25 +09:00
Ian Barwick
ff07763242 repmgr: update --help output
Display database connection options.
2017-08-22 15:07:22 +09:00
Ian Barwick
7ca396b9cb Add missing Barman options check 2017-08-21 14:10:08 +09:00
Ian Barwick
594e9e5007 Document upgrade process from repmgr3
Also provide unpackaged extension upgrade SQL, and a script to
assist converting repmgr.conf files.
2017-08-17 23:37:31 +09:00
Ian Barwick
da24d883e5 Remove option "--wal-keep-segments"
This is a remnant of the early repmgr days when there were no alternative
mechanisms for ensuring sufficient WAL remains available while cloning a
standby.

The purpose of this setting was to override a check for an (arbitrary)
minimum setting for "wal_keep_segments". As there's no reliable way
of determining a sensible value for this, and improvements in
pg_basebackup mean WALs can be streamed (possibly using a replication
slot) while the backup is in progress, there's no point in keeping
this around.

We will however still emit a warning about setting "wal_keep_segments"
if the configuration doesn't appear to provide any other way of
ensuring WAL is available during/after the cloning process and
"wal_keep_segments" is not set.
2017-08-17 14:45:13 +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
8ff545f9ae Add --help output for "repmgr cluster" 2017-08-16 16:33:07 +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