Fix follow_primary creation in pgpool_setup.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 9 Feb 2021 06:12:02 +0000 (15:12 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 9 Feb 2021 11:06:29 +0000 (20:06 +0900)
Since PostgreSQL 13 it is possible to reload the change of
recovery_conninfo, but it is not possible to reload
recovery_command. To fix this use pg_ctl restart regardless the
version of PostgreSQL.

Also fix an oversight: forgot to create standby.signal.

src/test/pgpool_setup.in

index 07036a3a1464fe590113a24eca4cb6a4ee9e0ce2..465c2bb96717987bdbcbf21680b9750897d1f832 100644 (file)
@@ -260,17 +260,14 @@ else
    sed -i "/restore_command/s/data[0-9]/`basename $new_primary_db_cluster`/" $db_cluster/myrecovery.conf
 fi
 
+touch $db_cluster/standby.signal
+
 # Skip the target standby node if it's not running
 $pg_ctl -D $db_cluster status >/dev/null 2>&1
 if [ $? = 0 ]
 then
-    if [ $pgversion -ge 130 ];then
-       echo "reload the target server" >> $log
-       $pg_ctl -m f -D $db_cluster reload >> $log 2>&1
-    else
-       echo "restart the target server" >> $log
-       $pg_ctl -w -m f -D $db_cluster restart >> $log 2>&1
-    fi
+    echo "restart the target server" >> $log
+    $pg_ctl -w -m f -D $db_cluster restart >> $log 2>&1
     # attach the node
     pcp_attach_node -w -h localhost -p $PCP_PORT -n $node_id >> $log 2>&1
 else