Fix oversight in previous commit for pgpool_setup.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Fri, 7 Aug 2020 00:21:34 +0000 (09:21 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Fri, 7 Aug 2020 00:27:53 +0000 (09:27 +0900)
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.

src/test/pgpool_setup

index 50c236d5e24f784584df7ac96f23fdda79d17648..4f6f08175b7f5f133c1b39e2e2624cb0d8274d12 100755 (executable)
@@ -423,9 +423,6 @@ EOF
 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
@@ -447,7 +444,6 @@ mkdir $DEST_CLUSTER/pg_wal
 chmod 700 $DEST_CLUSTER/pg_wal
 
 rm $DEST_CLUSTER/recovery.done
-rm standby.signal
 fi
 EOF
 
@@ -494,6 +490,7 @@ fi
 if [ $pg_rewind_failed = "false" ];then
     cp /tmp/postgresql.conf $DEST_CLUSTER/
 fi
+touch $DEST_CLUSTER/standby.signal
 EOF
 
 #-------------------------------------------