Fix pgpool_setup problem with -r option and PostgreSQL 12.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 5 Aug 2020 01:47:06 +0000 (10:47 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 5 Aug 2020 01:47:06 +0000 (10:47 +0900)
pgpool_setup -r uses pg_rewind if it's possible. After rewinding,
pgpool_setup failed to create standby.signal file, which is required in
PostgreSQL 12 or later, on the recovered target node. As a result, the
recovered node booted up as a primary server, rather than a standby
server.

Discussion: https://www.pgpool.net/mantisbt/view.php?id=624

src/test/pgpool_setup

index e05a1c6392c2dd823429ee25686af395eaed6a28..5e33225cc8eb82af610db68e84c52eb9fed52684 100755 (executable)
@@ -431,6 +431,7 @@ fi
 
 cat >> $1/$SCRIPT <<'EOF'
 touch standby.signal
+touch $DEST_CLUSTER/standby.signal
 
 if [ $pg_rewind_failed = "true" ];then
 
@@ -452,7 +453,7 @@ rm -fr $DEST_CLUSTER/pg_wal
 mkdir $DEST_CLUSTER/pg_wal
 chmod 700 $DEST_CLUSTER/pg_wal
 
-rm $DEST_CLUSTER/recovery.done standby.signal
+rm $DEST_CLUSTER/recovery.done
 rm standby.signal
 fi
 EOF