Commit:
https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=
de133ec848850dac516d805bfbc18873e1a53543
left standby.signal in the recovery target node in case when pg_rewind
is used. As a result, the standby node became primary after
restart.
fi
cat >> $1/$SCRIPT <<'EOF'
-touch standby.signal
-touch $DEST_CLUSTER/standby.signal
-
if [ $pg_rewind_failed = "true" ];then
$psql -p $PORT -c "SELECT pg_start_backup('Streaming Replication', true)" postgres
chmod 700 $DEST_CLUSTER/pg_wal
rm $DEST_CLUSTER/recovery.done
-rm standby.signal
fi
EOF
if [ $pg_rewind_failed = "false" ];then
cp /tmp/postgresql.conf $DEST_CLUSTER/
fi
+touch $DEST_CLUSTER/standby.signal
EOF
#-------------------------------------------