Commit Graph

1661 Commits

Author SHA1 Message Date
Ian Barwick
38b3447bd3 Add repmgr home page to --help output
Per PostgreSQL commit 1933ae629e7b706c6c23673a381e778819db307d it seems
to be all the rage these days.
2020-04-24 09:41:56 +09:00
Ian Barwick
3200c8c4e4 doc: clarify usage of the "passfile" parameter. 2020-04-23 15:03:40 +09:00
Ian Barwick
971309c830 Fix parsing of database connection check results in "standby clone" 2020-04-23 13:19:20 +09:00
Ian Barwick
1628bfb846 Update references to "recovery.conf" in _do_create_replication_conf() 2020-04-23 11:42:13 +09:00
Ian Barwick
8adcb1348d repmgrd: improve logging of promote_command failure
- log failure *before* we check if the primary has reappeared
- log the error code
2020-04-21 15:02:15 +09:00
Ian Barwick
025e66ea46 standby switchover: check superuser connection on demotion candidate
Add a sanity check that rempgr, when remotely executed on the demotion
candidate, is able to connect as superuser. If not, emit a diagnostic
command as a hint.
2020-04-21 11:25:01 +09:00
Ian Barwick
4e48301d78 standby switchover: note database name for superuser connections
It's useful to have a confirmation of which database repmgr is trying
to connect to when the -S/--superuser connection is provided.

It will always be the database defined in the repmgr.conf "conninfo"
parameter, but having the name available is useful when e.g.
troubleshooting issues with .pgpass configuration.
2020-04-20 16:49:47 +09:00
Ian Barwick
f8b214f721 doc: have Makefile clean up generated html files 2020-04-20 15:40:13 +09:00
Ian Barwick
96acd3f915 doc: clarify .pgpass usage with -S/--superuser option 2020-04-20 15:34:29 +09:00
Ian Barwick
c1584d587c doc: remove DEBUG output from example 2020-04-20 12:14:47 +09:00
Ian Barwick
2f26a02b5c doc: clarify usage of -F/--force with "standby promote"
Per GitHub #632.
2020-04-20 12:11:49 +09:00
Ian Barwick
cb2fb53556 Fix debug logging
Per GitHub #630.
2020-04-20 11:07:51 +09:00
Ian Barwick
e1953742a1 doc: note additional diagnostic options provided by "node check" 2020-04-17 11:53:56 +09:00
Ian Barwick
97d83bd443 standby switchover: add hint for diagnosing remote DB connection failure
Output a command, which when excuted on the local node (promotion
candidate) will attempt to remotely connect to the demotion candidate
and display both the connection message encountered and the connection
parameters used.

This is useful for corner-cases where the connection normally succeeds if a
particular environment variable (e.g. PGPORT) is normally set, but is
not set in the environment where SSH is executed.
2020-04-17 11:20:02 +09:00
Ian Barwick
45e96f21a5 node check: add option --db-connection
This is intended for diagnostic purposes, primarily when diagnosing
the connection parameters used when repmgr is being executed on a
remote node.
2020-04-15 17:48:23 +09:00
Ian Barwick
9df1731fb8 doc: update release notes 2020-04-15 14:50:51 +09:00
Ian Barwick
cfd35852b7 standby switchover: improve archive check error handling
Explicitly log if a database connection failure caused the check
to fail.

It's unlikely this situation will be encountered, as the data directory
check will already have run and checked for connection failure, however
there's a small chance the connection could fail between checks.
2020-04-15 14:08:33 +09:00
Ian Barwick
32dde4eaaf standby switchover: improve directory check failure handling
It's possible that the remote data directory check will fail if e.g.
connection configuration is not consistent across all nodes. This
modification ensures a database error connection is reported, rather
than a spurios issue with the data directory configuration.
2020-04-15 14:08:29 +09:00
Ian Barwick
78f89a4d47 node check: report connection error if --optformat provided
The --optformat option is intended for use when repmgr is being invoked
remotely by another repmgr instance, typically during a switchover
operation.

Previously no output was returned if the local repmgr was unable to
connect to its local PostgreSQL instance, which made diagnosing
various corner-case problems trickier than it should be.
2020-04-15 14:08:25 +09:00
Ian Barwick
410dd40526 standby switchover: standardize log message 2020-04-15 10:24:44 +09:00
Ian Barwick
3d85d8f5ff doc: update link to Debian package archive
See also https://www.df7cb.de/blog/2020/apt-archive.postgresql.org.html
2020-04-14 12:32:59 +09:00
Ian Barwick
d20711c267 Update Makefile for 5.2dev 2020-04-13 17:49:58 +09:00
Ian Barwick
e4a7da0132 Add upgrade route for repmgr 3.x to repmgr 5.1
The removal of some extensions functions means it's not possible to
follow the conventional incremental upgrade path; instead we'll
create a script for direct upgrades to 5.1.
2020-04-13 17:45:19 +09:00
Ian Barwick
4f0e8a503a doc: fix typo in 5.1.0 release section ID 2020-04-13 17:17:06 +09:00
Ian Barwick
c39289d570 doc: finalize release notes 2020-04-13 17:17:01 +09:00
Ian Barwick
662b603770 doc: update release notes 2020-04-13 17:16:55 +09:00
Ian Barwick
fa4f37ddb9 Bump master branch to 5.2dev 2020-04-08 14:22:51 +09:00
Ian Barwick
599bab590a Create temporary pg.auto.conf file with the same permissions as the original
Commit 0574279 set the file permissions to 0600 rather than the user's
umask, but if initdb was executed with -g/--allow-group-access, the
file is maintained with 0640, so we'll just maintain the existing
permssions.
2020-04-07 13:29:59 +09:00
Ian Barwick
cd80f265ac standby clone: warn about missing pg_rewind prerequisites
These are not essential for cloning a standby, but useful to warn
as early as possible in case the user is intending to use pg_rewind.
2020-04-06 15:37:37 +09:00
Ian Barwick
09f0be8ceb Minor log output fixes 2020-04-06 13:19:58 +09:00
Ian Barwick
59159dede7 Ensure next release is 5.1, not 5.1.0 2020-04-03 14:57:17 +09:00
Ian Barwick
780453e168 repmgrd: clarify log messages
Display the identity of the node question in the meassges fixed
in commit 8a27c89; this makes it easier to diagnose log output.
2020-04-03 13:02:49 +09:00
Tom Janson
8a27c89d18 repmgrd: fix inverted log message
Warning is emitted when the node in question is in recovery.
2020-04-03 12:39:36 +09:00
Ian Barwick
0a2091d5d3 repmgrd: handle new primary notification during failover check
It's possible a repmgrd instance might still be in the primary check
phase while a primary has already been promoted. Therefore it's
necessary to check for new primary notifications here, so we can
follow a new primary as quickly as possible.
2020-04-02 15:45:14 +09:00
Ian Barwick
447054a630 standby promote: in --dry-run mode, display promote command which will be used
For PostgreSQL 12 and later, explicitly note whether repmgr user has
execution permissions on the pg_promote() function.
2020-04-02 12:37:32 +09:00
Ian Barwick
d998cab3d0 doc: add note about granting permissions on pg_promote() 2020-04-02 11:32:02 +09:00
Ian Barwick
7f460c88bf doc: update "node check" examples
Also add example output for a standby.
2020-03-31 11:09:00 +09:00
Ian Barwick
e59da2d74e node check: display upstream info before downstream info
It makes more sense that way.
2020-03-31 11:08:28 +09:00
Ian Barwick
bffb8fa11b node check: handle --upstream option when node is primary 2020-03-31 10:49:30 +09:00
Ian Barwick
d9cb38c7f0 node check: add --upstream option
We have a --downstream option to check for attached nodes, but it
would be useful to have a corresponding --upstream option too.

A following patch will adapt the behaviour of this option when executed
on the primary node.
2020-03-30 17:54:52 +09:00
Ian Barwick
f3258c5002 cluster cleanup: explicitly log vacuum operation 2020-03-26 11:38:51 +09:00
Ian Barwick
5d92c99bb9 standby switchover: warn if no superuser connection available 2020-03-26 11:18:04 +09:00
Ian Barwick
6895916914 node service: explicitly note the node identity where CHECKPOINT issued
This output is logged during "standby switchover", so it's useful to be
aware of which node the activity is being performed on.
2020-03-25 14:00:55 +09:00
Ian Barwick
e64349e4da standby switchover: accept -S/--superuser option 2020-03-25 14:00:51 +09:00
Ian Barwick
2e9bc31c8c Consolidate code for establishing a superuser connection 2020-03-25 11:02:31 +09:00
Ian Barwick
325e3ea541 Update "repmgr node" help output 2020-03-25 09:37:49 +09:00
Ian Barwick
2b06f2d1ae node service: enable provision of the -S/--superuser option
This is required to be able to execute a CHECKPOINT if the normal
repmgr user is not a superuser.
2020-03-24 17:25:34 +09:00
Ian Barwick
304c1391cc node action: don't attempt to issue a CHECKPOINT as non-superuser
Raise a warning instead.
2020-03-24 17:25:27 +09:00
Ian Barwick
b09631b3bc doc: clarify pg_promote() usage 2020-03-24 15:40:26 +09:00
Ian Barwick
e561ddc8d3 node check: accept -S/--superuser option
This is mainly useful for the --data-directory-config option, which
requires permission to read pg_settings to verify that the data
directory configured in "repmgr.conf" matches the data directory
actually in use.

If pg_settings read permission is not available, repmgr will fall
back to a simple check that the data directory configured in
"repmgr.conf" is a valid PostgreSQL directory. This is not entirely
foolproof, as it's possible PostgreSQL could be using a different
data directory.
2020-03-23 17:14:04 +09:00