pgpool2.git / summary / log / commit / refs
commit 81684bb226ca5add2ce5e0ed080dcbbcc541e608
Author: Tatsuo Ishii <ishii@sraoss.co.jp>
Date: Fri May 14 22:30:43 2021 +0000
Fix 018.detach_primary test.
The script tried to extract primary node id from the results of show
pool_nodes. From 4.3 it includes the actual backend status. As a
result the script could accidentally picks up a node id which is
actually a standby (but has primary status as PostgreSQL) from
Pgpool-II's point of view.
This resulted in a shell syntax error here because $primary_node could
have node "0 2" for example.
if [ $primary_node != 0 ];then
src/test/regression/tests/018.detach_primary/test.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/test/regression/tests/018.detach_primary/test.sh b/src/test/regression/tests/018.detach_primary/test.sh
index 82e01a478..ed86edce5 100755
--- a/src/test/regression/tests/018.detach_primary/test.sh
+++ b/src/test/regression/tests/018.detach_primary/test.sh
@@ -38,7 +38,8 @@ $PG_CTL -D data2 promote
sleep 10
wait_for_pgpool_startup
$PSQL -c "show pool_nodes" postgres > show_pool_nodes
-primary_node=`grep primary show_pool_nodes|awk '{print $1}'`
+cat show_pool_nodes
+primary_node=`grep primary show_pool_nodes|grep -v standby|awk '{print $1}'`
if [ $primary_node != 0 ];then
echo "primary node is not 0"
./shutdownall
[parent: 7eb7d4b94c10]