diff -Nru patroni-1.6.4/debian/changelog patroni-1.6.4/debian/changelog --- patroni-1.6.4/debian/changelog 2020-03-03 12:09:39.000000000 +0000 +++ patroni-1.6.4/debian/changelog 2020-03-30 07:28:32.000000000 +0000 @@ -1,3 +1,27 @@ +patroni (1.6.4-2ubuntu1) focal; urgency=low + + * Merge from Debian unstable. Remaining changes: + - Mark new consul/zookeper tests as flaky too + - Disable etcd test, not working everywhere + See Debian bugs: #952536, #952535 + + -- Gianfranco Costamagna Mon, 30 Mar 2020 09:28:32 +0200 + +patroni (1.6.4-2) unstable; urgency=medium + + * debian/pg_clonecluster_patroni: quote connstr in pg_createcluster + invocation (Closes: #953623). + * debian/pg_createcluster_patroni: remove vip-manager file before appending + to it, patch by Tomas Pospisek (Closes: #953147). + * debian/pg_createcluster_patroni: Improve parsing of pg_lsclusters output + when determining port number, patch by Tomas Pospisek (Closes: #953157). + * debian/tests/acceptance: Set ETCD_UNSUPPORTED_ARCH to arm/arm64 according + to $DEB_HOST_ARCH (Closes: #952535). + * debian/config.yml.in: Add commented-out exemplary bootstrap/initdb and + bootstrap/users sections. + + -- Michael Banck Sat, 28 Mar 2020 10:19:53 +0100 + patroni (1.6.4-1ubuntu3) focal; urgency=medium * Mark new consul/zookeper tests as flaky too diff -Nru patroni-1.6.4/debian/config.yml.in patroni-1.6.4/debian/config.yml.in --- patroni-1.6.4/debian/config.yml.in 2019-11-15 09:38:53.000000000 +0000 +++ patroni-1.6.4/debian/config.yml.in 2020-03-29 11:07:45.000000000 +0000 @@ -67,6 +67,17 @@ - host replication all 127.0.0.1/32 md5 - host replication all ::1/128 md5 - host replication all @NETWORK@ md5 +# # Some possibly desired options for 'initdb' +# initdb: # Note: It needs to be a list (some options need values, others are switches) +# - encoding: UTF8 +# - data-checksums +# # Additional users to be created after initializing the cluster +# users: +# foo: +# password: bar +# options: +# - createrole +# - createdb postgresql: # Custom clone method diff -Nru patroni-1.6.4/debian/pg_clonecluster_patroni patroni-1.6.4/debian/pg_clonecluster_patroni --- patroni-1.6.4/debian/pg_clonecluster_patroni 2019-01-28 12:36:22.000000000 +0000 +++ patroni-1.6.4/debian/pg_clonecluster_patroni 2020-03-29 11:07:45.000000000 +0000 @@ -40,5 +40,5 @@ pg_dropcluster $VERSION $CLUSTER fi -pg_createcluster --start-conf=manual $VERSION $CLUSTER && rm -rf $DATADIR && pg_basebackup --pgdata $DATADIR -X stream --dbname=$CONNSTR +pg_createcluster --start-conf=manual $VERSION $CLUSTER && rm -rf $DATADIR && pg_basebackup --pgdata $DATADIR -X stream --dbname="$CONNSTR" exit $? diff -Nru patroni-1.6.4/debian/pg_createconfig_patroni patroni-1.6.4/debian/pg_createconfig_patroni --- patroni-1.6.4/debian/pg_createconfig_patroni 2019-11-16 14:40:23.000000000 +0000 +++ patroni-1.6.4/debian/pg_createconfig_patroni 2020-03-29 11:07:45.000000000 +0000 @@ -60,7 +60,7 @@ if [ -z "$PORT" ]; then # try to guess next free port - PORT=$(($(pg_lsclusters | awk '{print $3}' | grep -v Port | sort -n | tail -1) + 1)) + PORT=$(($(pg_lsclusters -h | awk '{print $3}' | sort -n | tail -1) + 1)) if [ "$PORT" -eq 1 ]; then # No cluster exists yet, use default port PORT=5432 @@ -89,6 +89,13 @@ # check vip configuration if [ -n "$VIP_IP" ]; then VIP_FILE=/etc/patroni/${VERSION}-${CLUSTER}.vip + if [ -f $VIP_FILE -a -z "$FORCE" ]; then + echo "VIP configuration file already exists" + exit 1 + else + rm -f $VIP_FILE + touch $VIP_FILE + fi if [ ! -e /etc/patroni/vip.in ]; then echo "VIP template /etc/patroni/vip.in does not exist, cannot write VIP file" exit 1 diff -Nru patroni-1.6.4/debian/tests/acceptance patroni-1.6.4/debian/tests/acceptance --- patroni-1.6.4/debian/tests/acceptance 2019-02-04 14:17:04.000000000 +0000 +++ patroni-1.6.4/debian/tests/acceptance 2020-03-29 11:07:45.000000000 +0000 @@ -29,8 +29,28 @@ # clean up afterwards trap 'rm -f /tmp/pgpass?; if [ $(id -u) -eq 0 ] && [ -x /etc/init.d/zookeeper ]; then /etc/init.d/zookeeper stop; fi' 0 2 3 15 +# set ETCD_ARCH for ETCD_UNSUPPORTED_ARCH +# see https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/supported-platform.md#current-support +ETCD_ARCH= +DEB_HOST_ARCH=$(dpkg-architecture -qDEB_HOST_ARCH) +case $DEB_HOST_ARCH in + arm64) + ETCD_ARCH=arm64 + ;; + armel) + ETCD_ARCH=arm + ;; + armhf) + ETCD_ARCH=arm + ;; + i386) + ETCD_ARCH=386 + ;; +esac + set -x for PG_VERSION in /usr/lib/postgresql/*; do - $SU "ETCD_UNSUPPORTED_ARCH=386 DCS=$DCS PATH=/usr/lib/postgresql/$(basename ${PG_VERSION})/bin:$PATH behave" || \ + $SU "ETCD_UNSUPPORTED_ARCH=$ETCD_ARCH DCS=$DCS PATH=/usr/lib/postgresql/$(basename \ + ${PG_VERSION})/bin:$PATH behave" || \ (for file in $(ls features/output/*_failed/*); do echo "$file:"; cat $file; done && exit 1) done