Commit Graph

1732 Commits

Author SHA1 Message Date
Ian Barwick b007d5ed4b doc: update README
Link to compatibility matrix, support section.
2019-10-24 09:42:23 +09:00
Ian Barwick 63ddc2d39e Let _establish_db_connection() work with replication connections
Previously this was limited to establish_db_connection_by_params().
2019-10-23 14:45:44 +09:00
Ian Barwick 9976e646cd doc: update README 2019-10-23 13:45:34 +09:00
Ian Barwick dc11330d58 Rename replication slot create/drop functions
Append "_sql" to the respective function names, as we'll later be
creating equivalent functions which use the replication protocol
so need a way to distinguish between them.
2019-10-23 13:43:09 +09:00
Ian Barwick be494f0d5f standby clone: minimize requirement to check upstream data directory location
repmgr has always insisted on determining the upstream's data directory
location, which requires superuser permissions (or from PostgreSQL 10,
membership of the default role "pg_read_all_settings").

Knowledge of the data directory location was required to implement rsync
cloning (now deprecated), but with pg_basebackup the minimum permission
requirement is now only a normal user with access to the repmgr metadata
and a user with replication permissions. The ability to determine the
data directory location is only required if the user specifies the
--copy-external-config-files option, which needs to be able to determine
the data directory to work out which configuration files are located
outside it.

This patch makes it possible to clone a standby with minimum
permissions, with appropriate checks for available permissions if
--copy-external-config-files is provided.

Implements part of GitHub #536 and addresses issue raised in #586.
2019-10-23 10:46:40 +09:00
Ian Barwick d7fd55be99 Update HISTORY 2019-10-18 16:47:28 +09:00
Ian Barwick 0574279ccb Ensure postgresql.auto.conf is created with correct permissions 2019-10-18 16:45:46 +09:00
Ian Barwick b74f965f54 standby clone: rename --recovery-conf-only to --replication-conf-only
A more generic option name to cover pre- and post-Pg12 replication
configuration methods.

--recovery-conf-only is retained as an alias for backwards
compatibility.
2019-10-18 14:44:57 +09:00
Ian Barwick b9e360d5b8 Tweak "repmgr standby --help" output not to mention recovery.conf
Use the more generic "replication configuration" to cover Pg12
and later.
2019-10-18 14:09:54 +09:00
Ian Barwick 047249e980 doc: expand section about requesting support 2019-10-18 11:58:13 +09:00
Ian Barwick 14f46b076e doc: add link to blog entry about Pg12 replication configuration changes 2019-10-18 11:57:52 +09:00
Ian Barwick 52abe309df Add function is_replication_role() 2019-10-17 17:13:18 +09:00
Ian Barwick f45b9d7024 Call check_93_config() directly from check_upstream_config() 2019-10-16 16:57:53 +09:00
Ian Barwick de67fa2441 standby clone: simplify data directory check
Now we no longer care about the upstream's data directory, and
normally expect to find the data directory in repmgr.conf, we
can just exit with an error in the corner case that no repmgr.conf
is provided and no data directory specified with -D/--pgdata.
2019-10-16 16:06:26 +09:00
Ian Barwick 5f6d970fd9 standby clone: update code comment
Follow-up to 0dce03a
2019-10-16 15:45:20 +09:00
Ian Barwick 0dce03a5f8 standby clone: don't query upstream's data directory
In early repmgr versions, this used to be a requirement for cloning
via rsync, and/or as a fallback location if the user didn't supply
a data directory to clone into. However as rsync cloning has been
deprecated, and the data directory must be specified in repmgr.conf,
this is no longer required, and removing it simplifies user privilege
requirements.

Note that it is still possible to explicitly provide a target data
directory with -D/--pgdata, though this is primarily useful for
the niche use case where repmgr is used as a convenience tool to
clone a node which is not intended to become part of a repmgr
cluster.

This is part of the implementation of GitHub #536 for the minimizing
of user privilege requirements.
2019-10-16 13:21:29 +09:00
Ian Barwick 5d81e03d2d Bump master branch to 5.1dev 2019-10-16 11:04:37 +09:00
Ian Barwick fdb61a1dea Change version number from 5.0 to 5.0.0
Previous initial "major" releases were two-element only (e.g. 4.4);
beginning from repmgr 5 we want to ensure all version numbers have
three elements, for general consistency, including the generation
of package names.
2019-10-16 10:45:54 +09:00
Ian Barwick 8a38188c47 doc: split notes about PostgreSQL 9.3 and 9.4 support into a new subsection 2019-10-15 10:47:12 +09:00
Ian Barwick 5dcca6b053 doc: add note about 4.x development policy 2019-10-15 10:47:09 +09:00
Ian Barwick a0591afb1e doc: add repmgr 5.0 release date 2019-10-15 10:29:52 +09:00
Ian Barwick af1c889bc3 Bump version to 5.0 2019-10-14 15:10:40 +09:00
Ian Barwick 2304584679 Fix handling of upstream node change check
repmgrd has a check to see if the upstream node has unexpectedly
changed, e.g. if the repmgrd service is paused and the PostgreSQL
instance has been pointed to another node.

However this check was relying on the node record on the local node
being up-to-date, which may not be the case immediately after a
failover, when the node is still replaying records updated prior
to the node's own record being updated. In this case it will
mistakenly assume the node is following the original primary
and attempt to restart monitoring, which will fail as the original
primary is no longer available.

To prevent this, we check against the node's record on the upstream
node.

Addresses issue noted in GitHub #587 and #588.
2019-10-14 12:28:04 +09:00
Ian Barwick 4aaa24a5f8 Update configuration file conversion script
Ensure output is quoted.
2019-10-08 10:59:20 +09:00
Ian Barwick ea29af2e68 Remove mistakenly added file 2019-10-08 10:33:27 +09:00
Ian Barwick 7053ed5b51 doc: update links to Barman documentation 2019-10-08 10:30:41 +09:00
Ian Barwick a845d7126d doc: minor updates to "repmgr standby clone" reference
- remove references to repmgr 4.0.4 (present because feature
  was added in a minor release, but that's a long time ago)
- note configuration is appended to postgresql.auto.conf
2019-10-08 10:21:26 +09:00
Ian Barwick 1c317059cd doc: clarify use of --recovery-conf-only 2019-10-08 10:03:44 +09:00
Ian Barwick dcf5bfb649 doc: fix minor formatting error 2019-10-08 09:48:04 +09:00
Ian Barwick dbd3d34c89 doc; update repmgr.conf.sample
Note new PostgreSQL-style parsing and add link to documentation.
2019-10-07 18:28:16 +09:00
Ian Barwick f3c3320a9c doc: update examples in quickstart guide 2019-10-07 18:27:38 +09:00
Ian Barwick cfc5bde219 doc: update repmgr.conf samples in Barman section
From repmgr 5.x we really need to quote all the things.
2019-10-07 12:05:26 +09:00
Ian Barwick ea57269569 doc: improve instructions for cloning from Barman 2019-10-07 11:56:40 +09:00
Ian Barwick b885337abc Minor code formatting fix 2019-10-07 10:48:35 +09:00
Ian Barwick e8b5b92893 doc: improve Barman standby clone example 2019-10-03 15:52:32 +09:00
Ian Barwick 02bdcf657f doc: add link to FAQ section about 3rd party package compatibilty 2019-10-03 15:23:57 +09:00
Ian Barwick 405f70f769 doc: clarify barman-cli package usage
As of Barman 2.8, the barman-cli package has been merged with the core
Barman code, so is only requires an explicit mention for Barman 2.0 ~ 2.7.
2019-10-03 14:35:45 +09:00
Ian Barwick 577ca35de5 doc: remove reference to Barman 1.x.
Barman 1.x is very outdated and should no longer be used anyway.
2019-10-03 14:25:17 +09:00
Martín Marqués a557f2d69e Typo in the documentation of the repmgrd configuration
Signed-off-by: Martín Marqués <martin.marques@2ndquadrant.com>
2019-10-01 09:44:30 -03:00
Ian Barwick 1196821457 doc: update FAQ
Note pg_monitor default role as well, and link to relevant section
in the PostgreSQL documentation.
2019-10-01 10:29:44 +09:00
Ian Barwick c1d464f3da doc: add FAQ entry about 3rd-party PostgreSQL packages 2019-10-01 10:07:25 +09:00
Ian Barwick 4646bbc289 doc: standardize doc formatting
Indent with two spaces instead of one.
2019-10-01 09:44:04 +09:00
Ian Barwick bb9a0c2297 doc: update FAQ
Add note about repmgr 5 in the "What's the difference between the repmgr
versions?" item.
2019-10-01 09:41:49 +09:00
Ian Barwick 1ed8b1067a Prevent use of backend string functions
From PostgreSQL 12, port.h forcibly redefines printf() et al to use
the versions defined by PostgreSQL (pg_printf() et al). As this
causes linking issues in build environments which build pre-Pg12
versions against Pg12's libpq, ensure relevant macros defined
in port.h are undefined.
2019-09-26 12:47:51 +09:00
Ian Barwick a502b2cf96 Move function parse_repmgr_version() to a more appropriate location 2019-09-24 13:14:03 +09:00
Ian Barwick 8e6d111f32 Refactor remote_command() function
Use dynamic rather than fixed buffer to generate the command string.
2019-09-24 13:14:03 +09:00
Ian Barwick 50d4cee877 doc: link to GitHub release page 2019-09-24 11:37:25 +09:00
Ian Barwick db99e98236 doc: note flex required for source builds
From 5.0 onwards.
2019-09-24 11:34:24 +09:00
Ian Barwick 10f00b8822 repmgr: pass explicitly provided log level when executing repmgr remotely
This makes it possible to return log output when executing repmgr
remotely at a different level to the one defined in the remote
repmgr's repmgr.conf.

This is particularly useful when DEBUG output is required.
2019-09-17 15:38:43 +09:00
Ian Barwick 98e96f4375 doc: clarify configuration file changes 2019-09-17 13:01:03 +09:00