Commit Graph

945 Commits

Author SHA1 Message Date
Ian Barwick
c2dded1d7b Log text of failed queries at log level ERROR
Previously query texts were always logged at log level DEBUG, but
that doesn't help much in a normal production environment when
trying to identify the cause of issues.

Also make various other minor improvements to query logging and
handling of database errors.

Implements GitHub #498.
2018-08-29 10:09:51 +09:00
Ian Barwick
457dbbd267 "standby switchover": improve replication connection check
Previously repmgr would first check that a replication can be made
from the demotion candidate to the promotion candidate, however it's
preferable to sanity-check the number of available walsenders first,
to provide a more useful error message.
2018-08-24 16:31:46 +09:00
Ian Barwick
5485c06bc1 doc: fix internal link 2018-08-24 09:43:18 +09:00
Cédric Villemain
00ae42eb07 Fix grep to find conninfo
it used to use \t* but [[:space:]] should be better as it does match more kind
of spaces (the current one being broken in my case on RH7)
2018-08-24 09:20:51 +09:00
Ian Barwick
33525491ae doc: update package signing key link 2018-08-23 12:33:48 +09:00
Ian Barwick
8c84f7a214 doc: update source requirement links
Per report from Daymel Bonne.
2018-08-23 10:56:49 +09:00
Ian Barwick
efe4bed88e doc: improve event notification documentation
- add undocumented events (per report from Daymel Bonne)
 - split up list into sections for better overview
 - where feasible, add cross-links
2018-08-23 10:22:05 +09:00
Ian Barwick
9ba8dcbac3 doc: clarify statement about BDR HA support 2018-08-23 09:36:58 +09:00
Ian Barwick
a8996a5bfa doc: clarify when "standby follow" can be used.
The unqualified wording previously implied that any running server could
be rejoined with "standby follow", which is not the case with a
"split brain" primary.
2018-08-21 13:53:21 +09:00
Ian Barwick
4cbba98193 repmgr: add "cluster_cleanup" event
GitHub #492.
2018-08-20 16:48:08 +09:00
Ian Barwick
23e6b85de3 doc: document sources of old package versions 2018-08-20 14:16:48 +09:00
Ian Barwick
d5ecb09f22 doc: add information about snapshot packages 2018-08-20 13:03:04 +09:00
Ian Barwick
719dd93676 doc: update release notes 2018-08-20 12:33:11 +09:00
Ian Barwick
5747f1d446 repmgrd: improve cascaded standby failover handling
In particular, improve handling of the case where the standby follow
command fails due to the primary not being available.

GitHub #480.
2018-08-16 17:14:05 +09:00
Ian Barwick
9313b43cb1 repmgrd: fix PQExpBuffer handling in upstream failover handler
Was sometimes leading to blank log lines.
2018-08-16 16:14:14 +09:00
Ian Barwick
5aeb1b0589 repmgrd: don't imply primary is in recovery if it's not available 2018-08-16 15:31:25 +09:00
Ian Barwick
6c93388848 repmgrd: fix "repmgrd_upstream_reconnect" event notification
Upstream node is not always the primary node.

Per report in GitHub #480.
2018-08-16 14:57:11 +09:00
Ian Barwick
d4ad8ce20c "standby clone" - don't copy external config files in dry run mode
Avoid copying files during a --dry-run as it may introduce unexpected changes
on the target node. During an actual clone operation, any problems with
copying files will be detected early and the operation aborted before
the actual database cloning commences.

GitHub #491.
2018-08-16 14:03:39 +09:00
Ian Barwick
bacab8d31c "standby promote": improve log messages
Make it clearer what repmgr is waiting for, and what to do if the
promotion appears to fail.
2018-08-16 11:52:18 +09:00
Ian Barwick
14856e3a4d repmgrd: ensure primary connection handle is refreshed after reconnect
In some circumstances, if monitoring history was in use, repmgrd was attempting
to fetch the primary's current LSN on a stale connection handle.
2018-08-15 16:57:21 +09:00
Ian Barwick
ca9242badb repmgr: fix handling of slot creation error when cloning
If cloning from another node other than the intended upstream, and
replication slots are in use, once the cloning process is complete,
repmgr will attempt to connect to the intended upstream to create
the replication slot.

Previously it would abort with a connection error, but as this issue
is not fatal to the cloning process itself, and in some situations may
be intentional, it's better to log a warning and continue.

We should probably collate this (and any similar items needing
attention after the cloning operation) into a list output at the end,
otherwise the warning may get overlooked.
2018-08-15 15:11:13 +09:00
Ian Barwick
ff0929e882 doc: update FAQ
Explain why some values in recovery.conf are surrounded by pairs of single
quotes.
2018-08-15 14:48:23 +09:00
Abhijit Menon-Sen
8cd1811edb Fix upstream node name in warning
This log_warning is supposed to reproduce the error in the block above,
but used the current node's name instead of the intended upstream node.
2018-08-14 10:10:50 +09:00
Ian Barwick
bf15c0d40f doc: improve "repmgr cluster cleanup" documentation 2018-08-14 10:09:18 +09:00
Ian Barwick
9ae9d31165 repmgr: truncate version string if necessary
Some distributions may add extra information to PG_VERSION after
the actual version number (e.g. "10.4 (Debian 10.4-2.pgdg90+1)"), so
copy the version number string up until the first space is found.

GitHub #490.
2018-08-14 09:56:54 +09:00
Ian Barwick
d5064bdc02 doc: clarify repmgrd FAQ item
"priority" must be 0 or greater.
2018-08-10 10:53:08 +09:00
Ian Barwick
9d0524a008 doc: update FAQ
Add note about why repmgrd refuses to start up if the upstream is
not running.
2018-08-10 10:47:23 +09:00
Ian Barwick
5398fd2d22 doc: better explain where pg_bindir won't be applied
Basically any setting which can contain a user-defined script
*must* have the full path set, even if it's repmgr being executed.

We could potentially apply some heuristics to detect if the first
item in the setting is "repmgr" (or more precisely repmgrd's program
name), but this will require some careful thought and testing
that it works as intended.
2018-08-10 10:29:06 +09:00
Ian Barwick
4c44c01380 doc: update release notes 2018-08-10 09:52:39 +09:00
Ian Barwick
5113ab0274 repmgrd: fix startup on witness node when local data is stale
Previously, when running on a witness server, repmgrd didn't consider
the local cache of the "repmgr.nodes" table might be outdated, e.g.
as repmgrd wasn't running on the witness server during a failover,
so could potentially end up monitoring a former primary now running
as a standby.

When running on a witness server, at startup repmgrd will now scan
all nodes to determine the current primary, and refresh its local
cache from there. This will also ensure it can start up even if the
node currently registered as primary in the local cache is not available.

Implements GitHub #488 and #489.
2018-08-09 16:42:20 +09:00
Ian Barwick
25f68bb283 repmgrd: report version number *after* logger initialisation
This ensures the version number always makes it into the log destination.

Implements GitHub #487.
2018-08-08 15:45:48 +09:00
Ian Barwick
730f67258c Bump version
4.1.1
2018-08-07 15:22:11 +09:00
Ian Barwick
ca0e4de1ee doc: clarify witness server location 2018-08-07 13:11:27 +09:00
Ian Barwick
2fb0f056fe repmgrd: fix configuration file reloading
Don't allow "promote_command" or "follow_command" to be empty.

GitHub #486.
2018-08-02 16:35:36 +09:00
Ian Barwick
3a789d53e0 repmgrd: always reopen log file after receiving SIGHUP
For whatever reason, since at least repmgr 2.0 the log file was only
ever reopened if a configuration file change took place.

GitHub #485.
2018-08-02 10:51:18 +09:00
Ian Barwick
fb67b2cd4f doc: fix typo 2018-08-01 16:37:01 +09:00
Ian Barwick
9f07804b6a doc: update repmgrd log rotation configuration
In the sample logrotate configuration file, use "copytruncate" rather than "create",
as repmgrd currently doesn't reopen the log file (unless the configuration changes).

Per suggestion in GitHub #465.
2018-08-01 16:33:22 +09:00
Ian Barwick
d5b2fa2309 doc: update 2ndQuadrant repository locations in packaging appendix 2018-08-01 15:57:45 +09:00
Ian Barwick
d696c4019e repmgrd: consolidate SIGHUP handling
Move identical code blocks into single function.
2018-08-01 11:53:57 +09:00
Ian Barwick
e6ffbcc67a doc: add note about new repository structure to 4.1.0 release notes 2018-08-01 11:47:27 +09:00
Ian Barwick
e1410831e0 doc: update 4.1.0 release notes 2018-08-01 11:38:08 +09:00
Ian Barwick
cb4f6f6e3f doc: add release date for 4.1.0 2018-07-31 10:58:06 +09:00
Ian Barwick
75e5d79654 doc: update Debian installation instructions
2ndQuadrant repository structure has changed.
2018-07-31 10:53:04 +09:00
Ian Barwick
55fbe12971 doc: update RPM installation instructions
2ndQuadrant repository structure has changed.

Also remove reference to the old, very deprecated original repmgr RPM
repository.
2018-07-30 17:26:46 +09:00
Ian Barwick
db4199e08f doc: update document build version for 4.1 branch v4.1.0 2018-07-24 14:02:38 +09:00
Ian Barwick
0d9ed02729 doc: fix typo 2018-07-24 14:02:08 +09:00
Ian Barwick
8e9f0b802b Create 4.1 branch 2018-07-24 10:22:31 +09:00
Ian Barwick
c236405251 Update extension metadata for 4.1 release
This release does not make any changes to the extension database
objects.
2018-07-24 09:56:43 +09:00
Ian Barwick
527a5f7fee doc: update release notes and upgrade instructions 2018-07-24 09:54:06 +09:00
Ian Barwick
937cffd54c doc: clarify BDR repmgrd configuration
Link directly to section about configuring the "event_notification_command".
2018-07-23 13:21:11 +09:00