Commit Graph

1171 Commits

Author SHA1 Message Date
Ian Barwick e0a61afb7d Suppress connection error display in repmgr cluster show
This prevents connection error messages being mixed in
with `repmgr cluster show` output. Error message output can
still be enabled with the --verbose flag.

Fixes GitHub #215
2016-08-01 14:57:40 +09:00
Ian Barwick bbc88ce05c Miscellaneous code cleanup and typo fixes 2016-07-28 16:32:07 +09:00
Ian Barwick 61e907cf70 Update README
Default log level is NOTICE, not INFO.
2016-07-27 12:11:00 +09:00
Ian Barwick 02668ee045 Parse the contents of the "pg_basebackup_options" parameter in repmgr.conf
This is to ensure that when repmgr executes pg_basebackup it doesn't
add any options which would conflict with user-supplied options.

This is related to GitHub #206, where the -S/--slot option has been
added for 9.6 - it's important to check this doesn't conflict with
-X/--xlog-method.

While we're at it, rename the ErrorList handling code to ItemList
etc. so we can use it for generic non-error-related lists.
2016-07-26 16:12:43 +09:00
Ian Barwick 36eb26f86d Mark some variables as static. 2016-07-26 11:40:26 +09:00
Ian Barwick cbc2c7b3e6 From PostgreSQL 9.6, use pg_basebackup's -S/--slot option if appropriate
GitHub #206
2016-07-26 10:35:30 +09:00
Ian Barwick 8a28dadde4 Rename RECOVERY_FILE to RECOVERY_COMMAND_FILE
This is for consistency with the PostgreSQL source code (see:
src/backend/access/transam/xlog.c ), but as it's not exported
we need to define it ourselves anyway.
2016-07-26 09:19:52 +09:00
Ian Barwick 3eda7373ad Prevent duplicated parameters being passed to pg_basebackup
This was not a problem, but ugly.
2016-07-25 20:44:36 +09:00
Ian Barwick 34e574ac66 Update README
Add caveats for pg_rewind with 9.4 and 9.3 in particular, also fix typo.
2016-07-21 08:58:44 +09:00
Ian Barwick e8fcc3d7a6 repmgr: set default user for -R/--remote-user 2016-07-18 14:30:30 +09:00
Ian Barwick eba0f1d7ae Update README with note about using screen et al 2016-07-18 11:01:42 +09:00
Ian Barwick db32565b36 Add notes about setting pg_bindir for Debian/Ubuntu-based distributions.
repmgr doesn't know about pg_ctlcluster.

Per GitHub query #196.
2016-07-15 16:00:31 +09:00
Ian Barwick 94befc3230 repmgr standby clone historically accepts a hostname as third parameter 2016-07-15 11:17:05 +09:00
Ian Barwick 340899f082 Update README
Add note about 2ndQuadrant RPM repository.
2016-07-13 09:55:01 +09:00
Ian Barwick 76681c0850 Update code comments 2016-07-12 10:56:31 +09:00
Ian Barwick eebaef59a3 Remove unused error code ERR_BAD_PASSWORD 2016-07-12 09:36:50 +09:00
Ian Barwick ddaaa28449 README: update error code list 2016-07-12 09:35:52 +09:00
Ian Barwick e81bf869ec Update README with details about conninfo parameter handling
From 3.1.4 `repmgr` will behave like other PostgreSQL utilities
when handling database connection parameters, in particular
accepting a conninfo string and honouring libpq connection defaults.
2016-07-12 09:27:22 +09:00
Ian Barwick fa62d715c2 Make more consistent use of conninfo parameters
Removed the existing keyword array which has a fixed, limited number
of parameters and replace it with a dynamic array which can be
used to store as many parameters as reported by libpq.
2016-07-11 15:24:53 +09:00
Ian Barwick 72af24e1d6 Add missing space when setting "application_name" 2016-07-08 09:46:59 +09:00
Ian Barwick 61d617ae93 Improve default host/dbname handling
repmgr disallows socket connections anyway (the whole point of providing
the host is to connect to a remote machine) so don't show that as
a fallback default in the -?/--help output.
2016-07-08 08:34:15 +09:00
Ian Barwick 319fba8b1f Enable a conninfo string to be passed to repmgr in the -d/--dbname parameter
This matches the behaviour of other PostgreSQL utilities such as pg_basebackup,
psql et al.

Note that unlike psql, but like pg_basebackup, repmgr does not accept a
"left-over" parameter as a conninfo string; this could be added later.

Parameters specified in the conninfo string will override any parameters
supplied correcly (e.g. `-d "host=foo"` will override `-h bar`).
2016-07-08 08:31:14 +09:00
Ian Barwick c92ea1d057 Generate "primary_conninfo" using the primary connection's parameters
Having successfully connected to the primary, we can use the actual parameters
reported by libpq to create "primary_conninfo", rather than the limited
subset previously defined by repmgr. Assuming that the user can
pass a conninfo string to repmgr (see following commit), this makes it
possible to provide other connection parameters, e.g. related to
SSL usage.
2016-07-08 08:11:11 +09:00
Ian Barwick b2ca6fd35e Remove now-superfluous wildcard in rmtree() call 2016-07-07 09:51:55 +09:00
Martin c880187e89 Fix alignment and syntax 2016-07-06 15:52:58 -03:00
Jarkko Oranen 4724da41ad Add sample configuration for systemd support 2016-07-06 15:52:58 -03:00
Jarkko Oranen d44885b330 Allow overriding start, stop and restart commands issued by repmgr
This commit introduces three new options:
  - start_command
  - stop_command
  - restart_command

If these are set, repmgr will issue the specified command instead
of the default pg_ctl commands
2016-07-06 15:52:58 -03:00
Ian Barwick 72f9b0145a Use rmtree instead of executing "rm -rf"
This completes the task mentioned in b6b6439819
2016-07-06 15:55:56 +09:00
Ian Barwick 5e03ef40cb Update HISTORY 2016-07-06 15:48:14 +09:00
Ian Barwick 091541619d Fix repmgrd monitoring calculation when in archive recovery 2016-07-06 09:27:31 +09:00
Ian Barwick 5e9db47d12 Fix query in get_node_record_by_name() 2016-07-05 21:06:31 +09:00
Ian Barwick e8a0cd33b5 Ensure all node record structures are initialised 2016-07-05 11:33:06 +09:00
Ian Barwick 8cd79fd7dd Revert "repmgr: add option -B/--remote-pg_bindir for standby switchover"
This reverts commit c30447ac90.
2016-07-04 11:30:36 +09:00
Ian Barwick 013b4b4b8a Update README/TODO about following non-master server 2016-07-01 12:15:37 +09:00
Ian Barwick c5a721a3cf TODO: remove resolved item 2016-07-01 12:07:10 +09:00
Ian Barwick a6294b7da0 Update README.md
Add note about logging configuration and settings in `pg_ctl_options`
for switchover operations.
2016-07-01 10:47:20 +09:00
Ian Barwick a0f02e454c repmgr: during switchover check demotion candidate's pidfile
If the pidfile is still there after apparent shutdown, or we're
unable to access the server at all, something has gone wrong and
the switchover should be aborted.
2016-07-01 09:42:55 +09:00
Ian Barwick 69d9d137e0 repmgr: change default pg_ctl shutdown mode to "fast"
This matches the default pg_ctl behaviour (from 9.5) and is the
more sensible option for performing time-critical operations such
as switchover.
2016-07-01 08:52:26 +09:00
Ian Barwick 60bceae905 Use PQping only to check for server shutdown
Functionally there's no difference between that and attempting to
make an actual connection, so use one method only, which also
simplifies the code.
2016-07-01 07:50:27 +09:00
Ian Barwick 746c9793ed Better detect completion of demotion candidate shutdown
If a connection attempt fails, keep pinging the server until it
finally away, or the timeout kicks in.

Addresses issue reported in GitHub #188 and previously noted in
repmgr.c
2016-06-30 21:35:00 +09:00
Ian Barwick c30447ac90 repmgr: add option -B/--remote-pg_bindir for standby switchover
This enables the switchover operation to function if the remote server
(current primary) has a different binary directory to the current
server, and addresses the issue reported in GitHub #172.
2016-06-30 12:51:54 +09:00
Ian Barwick 097024a32f repmgr: add new error code ERR_SWITCHOVER_FAIL 2016-06-29 12:11:53 +09:00
Ian Barwick 66b7dbbed7 repmgr: use make_pg_path() consistently
Per comment from gciolli.
2016-06-29 11:33:33 +09:00
Ian Barwick 74f6f97f26 repmgrd: log whether in standby or witness monitor loop
This is mainly for development and debugging purposes.
2016-06-29 10:31:57 +09:00
Ian Barwick 968c2f1954 Add notes about connect_timeout conninfo parameter.
Per suggestion in GitHub #148
2016-06-27 13:57:40 +09:00
Ian Barwick bd76d0eb92 Update postgresql.org links to https 2016-06-27 12:32:10 +09:00
Ian Barwick f1ee6e19b6 Ensure configuration options correctly initialised in repmgrd.c
Per GitHub #150.

Also remove unused variable.
2016-06-27 11:26:05 +09:00
Ian Barwick fbb65b4a43 Remove RHEL packaging files.
There's no point in maintaining in parallel to the PGDG packages.
See also notes in GitHub #156.
2016-06-24 10:19:20 +09:00
Ian Barwick 3fac975de6 Prevent multiple nodes being registered with the same name.
Fixes GitHub #192.
2016-06-24 09:25:41 +09:00
Ian Barwick a2b5ba595a repmgrd: reword log message for clarity 2016-06-23 09:47:35 +09:00