Commit Graph

807 Commits

Author SHA1 Message Date
Ian Barwick dd7193715c Gracefully fail when node has not been registered 2015-03-02 10:38:44 +09:00
Ian Barwick f8f81f4bf1 Update HISTORY file with items included in 2.0.2
Also standardize on spaces instead of tabs
2015-03-02 08:04:18 +09:00
Ian Barwick 27a4780cc3 Update HISTORY 2015-03-02 07:58:06 +09:00
Ian Barwick b79bce5821 Support tablespace mapping in --rsync-only mode
This makes it practical to take a back with rsync where tablespaces
require remapping. It also makes tablespace remapping possible for
9.3, where pg_basebackup does not support this option.
2015-03-01 14:10:17 +09:00
Ian Barwick a69176fc1b tablespace_dirs -> tablespace_mapping
For consistency with the parameter name.
2015-02-28 11:03:03 +09:00
Ian Barwick 65dcce55e8 Remove redundant comment
Issue already addressed.
2015-02-28 10:54:42 +09:00
Ian Barwick ff30df3d96 In rsync mode, move pg_control last
Emulate the backup protocol as much as possible.
2015-02-27 19:27:46 +09:00
Ian Barwick 74e4b6aa3c Refactor rsync file/directory exclusion
Better simulate what goes on in 'src/backend/replication/basebackup.c';
avoid copying some files/directories introduced in 9.4.
2015-02-27 15:59:47 +09:00
Ian Barwick 22dd164cbb Clarify intent 2015-02-27 13:29:21 +09:00
Ian Barwick 63c416bb76 Set synchronous_commit to off for current session
Forward-ported from 2.x; need to verify it makes sense.
2015-02-27 11:40:57 +09:00
Ian Barwick e2c2f97307 Clarify repmgr.conf usage 2015-02-27 10:02:42 +09:00
Ian Barwick 41e9a370af Clarify repmgr.conf usage 2015-02-27 10:01:38 +09:00
Ian Barwick 2eb242553a Fix log message 2015-02-27 09:57:18 +09:00
Ian Barwick e3ecd3cdc5 Move cluster size check to an earlier point
Seems to make more sense that way.
2015-02-25 14:28:42 +09:00
Ian Barwick 32611f5f04 Add --rsync-only option
Sometimes it's desirable to re-sync a "stale" data directory
on a standby, rather than start from scratch with pg_basebackup().

This re-adds the rsync code from the 2.x series, with some
modifications.

TODO: tablespace support.
2015-02-25 14:17:09 +09:00
Ian Barwick ba254d2f06 Clarify comment 2015-02-24 16:00:28 +09:00
Magnus Hagander 69f842bbc2 Fix markup
This was broken in commit  8faf41dd94,
most likely because of a runaway search/replace.
2015-02-24 09:43:54 +09:00
Magnus Hagander 99e1c33668 Fix markup
This was broken in commit  8faf41dd94,
most likely because of a runaway search/replace.
2015-02-24 08:47:34 +09:00
Ian Barwick 6791bd9ad3 Clean up rempgr debugging output 2015-02-23 15:17:06 +09:00
Ian Barwick 3e6659dda0 Modify log message for consistency and testing
Pre-3.0: 'repmgr standby clone complete'
3.0: 'repmgr standby clone (using pg_basebackup) complete' or
     'repmgr standby clone (using rsync) complete'
2015-02-20 12:29:15 +09:00
Ian Barwick ce498e4d1e Update devel version string 2015-02-20 10:10:17 +09:00
Ian Barwick 0762b28679 Update HISTORY file with items included in 2.0.2
Also standardize on spaces instead of tabs
2015-02-17 16:12:37 +09:00
Ian Barwick 5dff3017c8 Update HISTORY file 2015-02-12 17:22:34 +09:00
Ian Barwick b453c6a533 Fix master port check
Check introduced in dc0dfe9b56
was comparing the provided database name instead of the port.
2015-02-12 14:44:05 +09:00
Ian Barwick 09c7ba95ac Update HISTORY notes 2015-02-12 14:42:23 +09:00
Ian Barwick e213f3b99d Fix master port check
Check introduced in dc0dfe9b56
was comparing the provided database name instead of the port.
2015-02-12 14:39:05 +09:00
Jaime Casanova eabb3cb1ab Add "--checksum" in rsync when using "--force"
If the user don't put that option in rsync_options using of "--force"
could be unsafe.
While the probability of failures because of this are low they aren't
zero.
2015-02-11 10:38:35 +09:00
Jaime Casanova e886e72f14 Add "--checksum" in rsync when using "--force"
If the user don't put that option in rsync_options using of "--force"
could be unsafe.
While the probability of failures because of this are low they aren't
zero.
2015-02-10 20:15:40 -05:00
Ian Barwick 1803a16c7e Detect changes to configuration file
This will prevent unnecessary reconnects to the upstream and
updates of the node record on the primary.
2015-02-10 12:35:19 +09:00
Ian Barwick 4f36b2c085 Probably needed. 2015-02-10 11:07:18 +09:00
Ian Barwick 19aba38327 Handle DB error when updating upstream node 2015-02-10 10:32:20 +09:00
Ian Barwick 2d82ade170 Clarify error message 2015-02-10 10:21:17 +09:00
Ian Barwick 21730899da Clarify error message.
Avoid implying there's a configuration file if none was provided.
2015-02-10 10:08:49 +09:00
Ian Barwick 94bc5bdf80 Remove unneeded function 2015-02-09 18:31:18 +09:00
Ian Barwick 1369fe5c79 Rename 'test_mode' to 'target_directory_provided'
Which describes its meaning more accurately.

Also update some comments.
2015-02-09 16:32:21 +09:00
Ian Barwick e71dd4945e Remove duplicated error message 2015-02-09 13:42:51 +09:00
Ian Barwick 49d1abf130 rempgr: adapt tablespace handling for 9.4 and later
See note in code about 9.3.

Also ensure that no empty parameters are passed to pg_basebackup.
2015-02-09 13:39:18 +09:00
Ian Barwick 01a33198fd Add configuration file parameter for pg_basebackup
"pg_basebackup_options"
  Enable custom options to be passed to pg_basebackup
  (e.g. --max-rate, --checkpoint, --xlogdir)

"tablespace_mapping"
  Analogue to pg_basebackup's (9.4 and later) -T/--tablespace-mapping
  option.

  Tablespace mapping could also be passed via "pg_basebackup_options",
  however by providing a separate parameter it makes the configuration
  file easier to read and allows us to verify the specified tablespaces
  exist (pg_basebackup won't do this, which can lead to undesired
  behaviour, i.e. attempting to create the tablespace in the original
  path).
2015-02-09 10:31:06 +09:00
Ian Barwick 1d28a2d08e runtime_options.wal_keep_segments is prepopulated with default value
Explicitly track if setting came from command line parameter.
2015-02-05 11:55:52 +09:00
Ian Barwick d4578e023e Mention use_replication_slots in sample config file 2015-02-05 11:19:54 +09:00
Ian Barwick 9ceef937eb Emit warning if -w/--wal-keep-segments used when use_replication_slots set 2015-02-05 11:17:23 +09:00
Ian Barwick f047ec9526 Use DEFAULT_WAL_KEEP_SEGMENTS in help output instead of hard-coded number 2015-02-04 14:08:55 +09:00
Ian Barwick a3f0e89a05 Improve pg_bindir parameter handling
Previously, the pg_bindir parameter was mandatory and could only be
provided in the repmgr.conf file, which was leading to the slightly
bizarre situation that e.g. for "clone standby", repmgr was complaining
that it didn't want the configuration file when it actually did.

pg_bindir is now optional - if not provided, it will use the default
path. It can be provided in the repmgr.conf file, or as a command
line parameter; the latter overrides the former.
2015-02-04 14:04:04 +09:00
Ian Barwick 3d9d0d98af Improve repmgr configuration file handling
Previous behaviour was somewhat counterintuitive, with an error
message being logged if no configuration file provided or found,
even though this is not actually an error.

Configuration files now handled like this:

- if a configuration file is explicitly provided (-f), error out
  if not found.

- if no configuration file explicitly provided, attempt to open
  default configuration file; if this does not exist, log
  notice and continue with default values.

Also, for 9.4 and later add a hint about replication slot usage
if 'use_replication_slots' not set.
2015-02-04 09:57:51 +09:00
Ian Barwick 49debcdf92 Add version check if replication slot usage requested
Replication slots require 9.4 or greater
2015-02-02 22:16:04 +09:00
Ian Barwick 7a760c32ff Store slot name in repl_nodes table 2015-02-02 17:57:15 +09:00
Ian Barwick b4b5e6cd30 do_standby_clone(): rename conn to primary_conn
For clarity.
2015-02-02 16:53:35 +09:00
Ian Barwick 2ece014952 Initial support for physical replication slots
Todo:
 - if slots specified in repmgr.conf, verify server version
 - store generated slot name in `repl_nodes` table
2015-02-02 15:53:53 +09:00
Ian Barwick 01360c3d39 Improve repl_status view. 2015-01-29 15:08:37 +09:00
Ian Barwick 031a726f04 Enable get_master_connection() to accept a null value for master_id
Saves worrying about the purpose of various superfluous ints
2015-01-29 11:25:01 +09:00