View Issue Details

IDProjectCategoryView StatusLast Update
0000391Pgpool-IIBugpublic2018-04-18 09:30
Reportertom-sato Assigned Tot-ishii  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionopen 
PlatformLinuxOSCentOS 7 (x86_64)OS Version7.4.1708
Product Version3.7.2 
Target Version3.7.3Fixed in Version3.7.3 
Summary0000391: no response from pcp_detach_node with -g option
DescriptionThere is no response from pcp_detach_node with -g option.
Steps To Reproduce$ mkdir test

$ cd test

$ PGPOOL_INSTALL_DIR=/usr PGPOOLDIR=/etc/pgpool-II PGBIN=/usr/pgsql-9.6/bin LPATH=/usr/pgsql-9.6/lib PGSOCKET_DIR=/var/run/postgresql pgpool_setup
Satrting set up in streaming replication mode
creating startall and shutdownall
creating failover script
creating database cluster /var/lib/pgsql/test/data0...done.
update postgresql.conf
creating pgpool_remote_start
creating basebackup.sh
creating recovery.conf
creating database cluster /var/lib/pgsql/test/data1...done.
update postgresql.conf
creating pgpool_remote_start
creating basebackup.sh
creating recovery.conf
temporarily start data0 cluster to create extensions
temporarily start pgpool-II to create standby nodes
 node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay
---------+---------------------+-------+--------+-----------+---------+------------+-------------------+-------------------
 0 | /var/run/postgresql | 11002 | up | 0.500000 | primary | 0 | true | 0
 1 | /var/run/postgresql | 11003 | down | 0.500000 | standby | 0 | false | 0
(2 行)

recovery node 1...pcp_recovery_node -- Command Successful
done.
creating follow master script
 node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay
---------+---------------------+-------+--------+-----------+---------+------------+-------------------+-------------------
 0 | /var/run/postgresql | 11002 | up | 0.500000 | primary | 0 | true | 0
 1 | /var/run/postgresql | 11003 | up | 0.500000 | standby | 0 | false | 0
(2 行)

shutdown all

pgpool-II setting for streaming replication mode is done.
To start the whole system, use /var/lib/pgsql/test/startall.
To shutdown the whole system, use /var/lib/pgsql/test/shutdownall.
pcp command user name is "postgres", password is "postgres".
Each PostgreSQL, pgpool-II and pcp port is as follows:
0000001 port is 11002
0000002 port is 11003
pgpool port is 11000
pcp port is 11001
The info above is in README.port.

$ ./startall
waiting for server to start....3691 2018-04-12 14:35:27 JST LOG: redirecting log output to logging collector process
3691 2018-04-12 14:35:27 JST HINT: Future log output will appear in directory "pg_log".
 done
server started
waiting for server to start....3703 2018-04-12 14:35:28 JST LOG: redirecting log output to logging collector process
3703 2018-04-12 14:35:28 JST HINT: Future log output will appear in directory "pg_log".
 done
server started

$ LANG=C psql -p 11000 -c "show pool_nodes"
 node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay
---------+---------------------+-------+--------+-----------+---------+------------+-------------------+-------------------
 0 | /var/run/postgresql | 11002 | up | 0.500000 | primary | 0 | true | 0
 1 | /var/run/postgresql | 11003 | up | 0.500000 | standby | 0 | false | 208
(2 rows)

$ pcp_detach_node -h /var/run/postgresql -p 11001 -n 1 -g
Password:

There is no responce here.
Additional Information$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

$ rpm -qa | grep -E 'postgresql|pgpool'
postgresql96-libs-9.6.8-1PGDG.rhel7.x86_64
postgresql96-server-9.6.8-1PGDG.rhel7.x86_64
pgpool-II-pg96-3.7.2-2pgdg.rhel7.x86_64
postgresql96-9.6.8-1PGDG.rhel7.x86_64
pgpool-II-release-3.7-1.noarch
pgpool-II-pg96-extensions-3.7.2-2pgdg.rhel7.x86_64

# ps ax | grep pgpool
  3728 pts/0 S 0:00 /usr/bin/pgpool -D -n -f /var/lib/pgsql/test/etc/pgpool.conf -F /var/lib/pgsql/test/etc/pcp.conf -a /var/lib/pgsql/test/etc/pool_hba.conf
  3730 pts/0 S 0:00 pgpool: wait for connection request
  3731 pts/0 S 0:00 pgpool: wait for connection request
  3732 pts/0 S 0:00 pgpool: wait for connection request
  3733 pts/0 S 0:00 pgpool: wait for connection request
  3734 pts/0 S 0:00 pgpool: wait for connection request
  3735 pts/0 S 0:00 pgpool: wait for connection request
  3736 pts/0 S 0:00 pgpool: wait for connection request
  3737 pts/0 S 0:00 pgpool: wait for connection request
  3738 pts/0 S 0:00 pgpool: wait for connection request
  3739 pts/0 S 0:00 pgpool: wait for connection request
  3740 pts/0 S 0:00 pgpool: wait for connection request
  3741 pts/0 S 0:00 pgpool: wait for connection request
  3742 pts/0 S 0:00 pgpool: wait for connection request
  3743 pts/0 S 0:00 pgpool: wait for connection request
  3744 pts/0 S 0:00 pgpool: wait for connection request
  3745 pts/0 S 0:00 pgpool: wait for connection request
  3746 pts/0 S 0:00 pgpool: wait for connection request
  3747 pts/0 S 0:00 pgpool: wait for connection request
  3748 pts/0 S 0:00 pgpool: wait for connection request
  3749 pts/0 S 0:00 pgpool: wait for connection request
  3750 pts/0 S 0:00 pgpool: wait for connection request
  3751 pts/0 S 0:00 pgpool: wait for connection request
  3752 pts/0 S 0:00 pgpool: wait for connection request
  3753 pts/0 S 0:00 pgpool: wait for connection request
  3754 pts/0 S 0:00 pgpool: wait for connection request
  3755 pts/0 S 0:00 pgpool: wait for connection request
  3756 pts/0 S 0:00 pgpool: wait for connection request
  3757 pts/0 S 0:00 pgpool: wait for connection request
  3758 pts/0 S 0:00 pgpool: wait for connection request
  3759 pts/0 S 0:00 pgpool: wait for connection request
  3760 pts/0 S 0:00 pgpool: wait for connection request
  3761 pts/0 S 0:00 pgpool: wait for connection request
  3763 pts/0 S 0:00 pgpool: PCP: wait for connection request
  3764 pts/0 S 0:00 pgpool: worker process
  3765 pts/0 S 0:00 pgpool: health check process(0)
  3766 pts/0 S 0:00 pgpool: health check process(1)
  3998 pts/0 S 0:00 pgpool: PCP: processing detach node request
  4132 pts/1 R+ 0:00 grep --color=auto pgpool

# strace -p 3998
strace: Process 3998 attached
select(0, NULL, NULL, NULL, {0, 645637}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {1, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {1, 0}^Cstrace: Process 3998 detached
 <detached ...>

# cat /var/lib/pgsql/test/log/pgpool.log
2018-04-12 14:35:29: pid 3728: LOG: Backend status file /var/lib/pgsql/test/log/pgpool_status discarded
2018-04-12 14:35:29: pid 3728: LOG: Setting up socket for ::1:11000
2018-04-12 14:35:29: pid 3728: LOG: Setting up socket for 127.0.0.1:11000
2018-04-12 14:35:29: pid 3728: LOG: find_primary_node_repeatedly: waiting for finding a primary node
2018-04-12 14:35:29: pid 3728: LOG: find_primary_node: checking backend no 0
2018-04-12 14:35:29: pid 3728: LOG: find_primary_node: primary node id is 0
2018-04-12 14:35:29: pid 3728: LOG: pgpool-II successfully started. version 3.7.2 (amefuriboshi)
2018-04-12 14:36:02: pid 3749: LOG: DB node id: 0 backend pid: 3824 statement: DISCARD ALL
2018-04-12 14:36:09: pid 3749: LOG: DB node id: 0 backend pid: 3844 statement: DISCARD ALL
2018-04-12 14:37:42: pid 3763: LOG: forked new pcp worker, pid=3998 socket=7
Tagspcp commands

Activities

t-ishii

2018-04-12 15:29

developer   ~0001994

Thanks for the report. There's a bug in pcp_detach_node: it does not do actual failover when -g is specified. Attached is a patch to fix the bug. Please try.
pcp_detach_node.diff (543 bytes)   
pcp_detach_node.diff (543 bytes)   

tom-sato

2018-04-13 13:02

reporter   ~0001995

Thanks for the patch. I applied the patch, then it worked correctly.

t-ishii

2018-04-13 13:17

developer   ~0001997

Thank you for testing. Issue resolved.

administrator

2018-04-18 09:30

administrator   ~0001998

Fixed in Pgpool-II 3.7.3 and released on April 17 2018.

Issue History

Date Modified Username Field Change
2018-04-12 14:50 tom-sato New Issue
2018-04-12 14:50 tom-sato Tag Attached: pcp commands
2018-04-12 15:26 t-ishii Assigned To => t-ishii
2018-04-12 15:26 t-ishii Status new => assigned
2018-04-12 15:29 t-ishii File Added: pcp_detach_node.diff
2018-04-12 15:29 t-ishii Note Added: 0001994
2018-04-12 15:29 t-ishii Status assigned => feedback
2018-04-13 08:12 t-ishii Target Version => 3.7.3
2018-04-13 13:02 tom-sato Note Added: 0001995
2018-04-13 13:02 tom-sato Status feedback => assigned
2018-04-13 13:17 t-ishii Note Added: 0001997
2018-04-13 13:18 t-ishii Status assigned => resolved
2018-04-18 09:30 administrator Status resolved => closed
2018-04-18 09:30 administrator Fixed in Version => 3.7.3
2018-04-18 09:30 administrator Note Added: 0001998