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
cat >> $1/$SCRIPT <<'EOF'
touch standby.signal
+touch $DEST_CLUSTER/standby.signal
if [ $pg_rewind_failed = "true" ];then
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