Commit Graph

1146 Commits

Author SHA1 Message Date
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
Ian Barwick
c16ab3c889 Fix handling of global PGconn variables in repmgrd
Don't call PQfinish before calling terminate(), elsewhere always
set to NULL after calling PQfinish().

This fixes GitHub #182.
2016-06-21 17:30:22 +09:00
Ian Barwick
dd5b6f9f12 Whitespace fixes 2016-06-21 16:04:41 +09:00
Ian Barwick
303bb22ee1 Note potential replication lag check improvement 2016-06-20 12:23:34 +09:00
Ian Barwick
5d8b1a3a31 monitoring: ensure that invalid replication_lag value is not inserted.
Per Github #189.
2016-06-20 10:55:25 +09:00
Ian Barwick
3d6c349d88 Rename "pg_restore_command" to "restore_command"
The 'pg_' prefix could cause confusion with actual binaries
(pg_ctl, pg_basebackup etc.) and there's no obvious reason
why we need it.
2016-06-17 14:43:02 +09:00
Ian Barwick
1ade1acb22 Report standby location as last apply location when in archive recovery
Otherwise the monitoring table's 'last_wal_standby_location' will stay at
the location of the last streaming WAL received.

This complements the bugfix applied in e814c1120e.
2016-06-15 15:41:10 +09:00
Ian Barwick
66fd003ab4 Schema-qualify pg_catalog objects 2016-06-10 17:58:10 +09:00
Ian Barwick
0d42b771f5 Remove unnecessary get_server_version() calls in do_standby_clone()
We cache the value at the start of the function, and it's reasonable to
assume that the server version is not going to suddenly change.
2016-06-06 23:41:47 +09:00
Ian Barwick
005640be51 Fix PQconninfoParse() return type check 2016-06-05 10:20:42 +09:00
Martin
b6ebd34e2f Some other indentation fixes found 2016-06-03 20:20:43 -03:00
Martin
951879f80d Typo noticed by Brett Maton. 2016-06-03 20:20:43 -03:00
Martin
46ff9fb587 No code change, just indentation was incorrect in the failover part
making it hard to read.
2016-06-03 20:20:43 -03:00
Ian Barwick
cc610f995d Whitespace and typo fixes 2016-06-03 21:25:22 +09:00
Martin
384618cb33 There was a missing table in sql/repmgr2_repmgr3.sql which made events
error when trying to insert them.

This is just a copy and paste from the table creation in repmgr.c

This fixes #184 reported by Andreas Kretschmer
2016-06-02 14:23:14 -03:00
Martin
0dd617cfca The ALTER TABLE to set the foreign key as DEFERRABLE only worked on
9.4+, as there is no ALTER CONSTRAINT in 9.3.

This new ALTER TABLE does the same in two hops by removing the foreign
key and creating it again in the same ALTER TABLE.

This fixes #183
2016-06-02 13:56:06 -03:00
Martin
f18d629bd2 Typo in a comment.
Reported by @nucfisher
2016-05-30 09:41:38 -03:00
Ian Barwick
afc904f876 Fix typos and whitespace 2016-05-30 16:01:38 +09:00
Ian Barwick
3bcea46c3b Clarify handling of tablespace_map file. 2016-05-30 10:48:08 +09:00
Ian Barwick
d7e85f7565 Clarify purpose of remapping code 2016-05-30 07:47:09 +09:00
Ian Barwick
b14d8ddb74 Ensure read_backup_label() does not exit on error
This would leave an unstopped backup; we'll let do_standby_clone()
do any cleanup necessary before exiting with an error.
2016-05-24 17:04:54 +09:00
Ian Barwick
9b2a907b09 Convert erroneously forgotten printf debug to proper logging 2016-05-24 16:44:22 +09:00
Martín Marqués
f63d42fe77 Merge pull request #178 from gciolli/master
Debian auto-build version upgrade
2016-05-23 14:48:28 -03:00
Gianni Ciolli
560066fa9d Basic CSV mode for "repmgr cluster show", enabled by --csv command
line option
2016-05-23 19:00:25 +02:00
Martin
3937670d14 Added logrotate configuration file (for those who would like one ;))
and changed parameters in sysconfig file so that we use /var/log for
logs and /var/run for pid files.
2016-05-23 13:30:05 -03:00
Gianni Ciolli
0daa7381b3 Debian auto-build version upgrade 2016-05-22 22:10:31 +02:00