Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main #185

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
7 changes: 3 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Pacemaker 1.1.13 using a corosync 2.x stack.
Changelog since 2.1:

* new: support PostgreSQL 10
* new: add the maxlag parameter to exclude lagging slaves from promotion, Thomas Reiss
* new: add the maxlag parameter to exclude lagging secondaries from promotion, Thomas Reiss
* new: support for multiple pgsqlms resources in the same cluster
* new: provide comprehensive error messages to crm_mon
* fix: follow the resource agent man page naming policy and section
Expand Down Expand Up @@ -93,7 +93,7 @@ Pacemaker 1.1.13 using a corosync 2.x stack.
* fix: check on application_name in validate_all
* change: do not start standby with a master score of 1
* change: choose the clone to promote when no master score exist
* new: detect and deal master/slave recovery transition
* new: detect and deal priamry/secondary recovery transition
* new: detect and enforce reliability of a switchover
* new: set next best secondaries base on their lag
* misc: code cleanup and refactoring
Expand Down Expand Up @@ -126,7 +126,7 @@ Release date: 2016-04-27
* fix: OCF tests when PostgreSQL does not listen in /tmp
* change: do not update score outside of a monitor action (gh #18)
* new: add parameter 'start_opts', usefull for debian and derivated (gh #11)
* new: add specific timeout for master and slave roles in meta-data (gh #14)
* new: add specific timeout for primary and secondary roles in meta-data (gh #14)
* new: add debian packaging related files


Expand All @@ -136,4 +136,3 @@ Release date: 2016-04-27
Release date: 2016-03-02

* First public release

25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ yet powerful.

Once your PostgreSQL cluster built using internal streaming replication, PAF is
able to expose to Pacemaker what is the current status of the PostgreSQL
instance on each node: master, slave, stopped, catching up, etc. Should a
failure occurs on the master, Pacemaker will try to recover it by default.
Should the failure be non-recoverable, PAF allows the slaves to be able to
elect the best of them (the closest one to the old master) and promote it as
the new master. All of this thanks to the robust, feature-full and most
instance on each node: primary, secondary, stopped, etc. Should a
failure occurs on the primary, Pacemaker will try to recover it by default.
Should the failure be non-recoverable, PAF allows the secondaries to be able to
elect the best of them (the closest one to the old primary) and promote it as
the new primary. All of this thanks to the robust, feature-full and most
importantly experienced project: Pacemaker.

For information about how to install this agent, see `INSTALL.md`.
Expand All @@ -40,10 +40,10 @@ CentOS 6 and 7 in various scenario.

PAF has been written to give to the administrator the maximum control
over their PostgreSQL configuration and architecture. Thus, you are 100%
responsible for the master/slave creations and their setup. The agent
responsible for the primary/secondary creations and their setup. The agent
will NOT edit your setup. It only requires you to follow these pre-requisites:

* slave __must__ be in hot_standby (accept read-only connections) ;
* secondary __must__ be in hot_standby (accept read-only connections) ;
* the following parameters __must__ be configured in the appropriate place :
* `standby_mode = on` (for PostgreSQL 11 and before)
* `recovery_target_timeline = 'latest'`
Expand All @@ -66,7 +66,7 @@ can set:
* `pghost`: the socket directory or IP address to use to connect to the
local instance (default: `/tmp` or `/var/run/postgresql` for DEBIAN)
* `pgport`: the port to connect to the local instance (default: `5432`)
* `recovery_template`: __only__ for PostgreSQL 11 and before. The local
* `recovery_template`: __only__ for PostgreSQL 11 and before. The local
template that will be copied as the `PGDATA/recovery.conf` file. This
file must not exist on any node for PostgreSQL 12 and after.
(default: `$PGDATA/recovery.conf.pcmk`)
Expand All @@ -76,11 +76,10 @@ can set:
`-c config_file=/etc/postgresql/9.3/main/postgresql.conf`
* `system_user`: the system owner of your instance's process (default:
`postgres`)
* `maxlag`: maximum lag allowed on a standby before we set a negative master
score on it. The calculation is based on the difference between the current
xlog location on the master and the write location on the standby.
(default: 0, which disables this feature)
* `maxlag`: maximum lag allowed on a standby before we set a negative
promotion score on it. The calculation is based on the difference between
the current xlog location on the primary and the write location on the
standby. (default: 0, which disables this feature)

For a demonstration about how to setup a cluster, see
[http://clusterlabs.github.io/PAF/documentation.html](http://clusterlabs.github.io/PAF/documentation.html).

33 changes: 4 additions & 29 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -108,53 +108,28 @@ resource-agents-paf (2.0.0-1) unstable; urgency=low
resource-agents-paf (2.0~rc1-1) unstable; urgency=low

* 2.0_rc1 first release candidate
* see CHANGELOG.md

-- Jehan-Guillaume (ioguix) de Rorthais <jgdr@dalibo.com> Wed, 3 Aug 2016 18:17:35 +0200

resource-agents-paf (2.0~beta2-1) unstable; urgency=low

* 2.0_beta2 beta release
* fix: bug in switchover with 9.5 and 9.6
* see CHANGELOG.md

-- Jehan-Guillaume (ioguix) de Rorthais <jgdr@dalibo.com> Fri, 1 Jul 2016 16:35:35 +0200

resource-agents-paf (2.0~beta1-1) unstable; urgency=low

* 2.0_beta1 beta release
* fix: do not use crm_node --partition to discover resources
* fix: unknown argument --query when calling crm_master
* fix: perl warning when master score has never been set on the master
* fix: remove wrong info message during post-promote notify
* fix: race condition when setting attributes during actions
* fix: bug where pgport and pghost where ignored in _query
* fix: use same role name than the system_user to connect
* fix: wrap crm_master calls in sub to make them synchronous
* fix: fixed a bug related to setgid in _runas
* fix: check on application_name in validate_all
* change: do not start standby with a master score of 1
* change: choose the clone to promote when no master score exist
* new: detect and deal master/slave recovery transition
* new: detect and enforce reliability of a switchover
* new: set next best secondaries base on their lag
* misc: code cleanup and refactoring
* misc: various log messages cleanup and enhancement
* see CHANGELOG.md

-- Jehan-Guillaume (ioguix) de Rorthais <jgdr@dalibo.com> Wed, 15 Jun 2016 23:19:58 +0200

resource-agents-paf (1.0.1-1) unstable; urgency=low

* 1.0.1 minor release
* fix: forbid the master to decrease its own score (gh #19)
* fix: bad LSN decimal converstion (gh #20)
* fix: support PostgreSQL 9.5 controldata output (gh #12)
* fix: set group id of given system_user before executing commands (gh #11)
* fix: use long argument of external commands when possible
* fix: bad header leading to wrong manpage section
* fix: OCF tests when PostgreSQL does not listen in /tmp
* change: do not update score outside of a monitor action (gh #18)
* new: add parameter 'start_opts', usefull for debian and derivated (gh #11)
* new: add specific timeout for master and slave roles in meta-data (gh #14)
* new: add debian packaging related files
* see CHANGELOG.md

-- Jehan-Guillaume (ioguix) de Rorthais <jgdr@dalibo.com> Wed, 27 Apr 2016 13:22:50 +0200

Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ Description: PostgreSQL resource agent for Pacemaker
the Pacemaker administration and the PostgreSQL one, to keep things simple,
documented and yet powerful.
.
It only supports multi-state (Master-Slave) PostgreSQL clusters.
It only supports multi-state (Primary-Secondary) PostgreSQL clusters.
4 changes: 2 additions & 2 deletions extra/vagrant/2nodes-qdevice-vip/provision/pgsql.bash
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ if [ "$NODENAME" == "$PRIM_NODE" ]; then

chown -R postgres:postgres "$PGDATA"

# create master ip
# create primary ip
ip -o addr show to "${PRIM_IP}" | if ! grep -q "${PRIM_IP}"
then
DEV=$(ip route show to "${PRIM_IP}/24"|grep -Eo 'dev \w+')
ip addr add "${PRIM_IP}/24" dev "${DEV/dev }"
fi

# restart master pgsql
# restart primary pgsql
systemctl --quiet start "postgresql-${PGVER}"

exit
Expand Down
2 changes: 1 addition & 1 deletion extra/vagrant/3nodes-haproxy/provision/pacemaker.bash
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ PGSQLD_RSC_OPTS=(
# NB: pcs 0.10.2 doesn't support to set the id of the clone XML node
# the id is built from the rsc id to clone using "<rsc-id>-clone"
# As a matter of cohesion and code simplicity, we use the same
# convention to create the master resource with pcs 0.9.x for
# convention to create the primary resource with pcs 0.9.x for
# Pacemaker 1.1
if [ "$PCMK_VER" -ge 2 ]; then
PGSQLD_RSC_OPTS+=( "promotable" "notify=true" )
Expand Down
2 changes: 1 addition & 1 deletion extra/vagrant/3nodes-haproxy/provision/pgsql.bash
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ if [ "$NODENAME" == "$PRIM_NODE" ]; then

chown -R postgres:postgres "$PGDATA"

# restart master pgsql
# restart primary pgsql
systemctl --quiet start "postgresql-${PGVER}"

exit
Expand Down
2 changes: 1 addition & 1 deletion extra/vagrant/3nodes-vip/provision/pgsql.bash
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ if [ "$NODENAME" == "$PRIM_NODE" ]; then

chown -R postgres:postgres "$PGDATA"

# create master ip
# create primary ip
ip -o addr show to "${PRIM_IP}" | if ! grep -q "${PRIM_IP}"
then
DEV=$(ip route show to "${PRIM_IP}/24"|grep -Eo 'dev \w+')
Expand Down
14 changes: 7 additions & 7 deletions lib/OCF_Functions.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ OCF_Functions - helper subroutines for OCF agent

use FindBin;
use lib "$FindBin::RealBin/../../lib/heartbeat/";

use OCF_Functions;

=head1 DESCRIPTION
Expand Down Expand Up @@ -257,7 +257,7 @@ sub ha_debug {
else {
printf STDERR "%s\n", join ' ', @ARG;
}

return 0;
}

Expand Down Expand Up @@ -375,9 +375,9 @@ sub ocf_is_clone {
and $ENV{'OCF_RESKEY_CRM_meta_clone_max'} > 0 );
}

# returns true if the resource is configured as a multistate
# (master/slave) resource. This is defined as a resource where the
# master-max meta attribute is present, and set to greater than zero.
# returns true if the resource is promotable.
# This is defined as a resource where the master-max meta attribute is present,
# and set to greater than zero.
sub ocf_is_ms {
return ( defined $ENV{'OCF_RESKEY_CRM_meta_master_max'}
and $ENV{'OCF_RESKEY_CRM_meta_master_max'} > 0 );
Expand All @@ -394,7 +394,7 @@ sub ocf_is_ver {

sub ocf_ver2num {
my $v = 0;

$v = $v * 1000 + $1 while $ARG[0] =~ /(\d+)/g;

return $v;
Expand Down Expand Up @@ -431,7 +431,7 @@ sub ocf_version_cmp {
my $v1_level;
my $v2_level;
my $level_diff;

return 3 unless ocf_is_ver( $v1 );
return 3 unless ocf_is_ver( $v2 );

Expand Down
Loading