View Issue Details

IDProjectCategoryView StatusLast Update
0000239Pgpool-IIBugpublic2017-08-11 23:13
Reportersupp_kAssigned ToMuhammad Usama 
Status assignedResolutionopen 
PlatformIntel x86 64OSCentOSOS Version 7.x
Product Version3.5.3 
Target VersionFixed in Version 
Summary0000239: invalid pcp socket directory
DescriptionThe pgpool.conf has the following setting:

pcp_port = 9898
pcp_socket_dir = '/var/run/pgpool'

But when I run the command: -bash-4.2$ pcp_watchdog_info

I see the error:

ERROR: connection to socket "/tmp/.s.PGSQL.9898" failed with error "No such file or directory"

I see the "pcp_socket_dir" parameter is ignored:
TagsNo tags attached.


Muhammad Usama

2016-08-30 00:13

developer   ~0001030

All PCP client side tools are independent of pgpool server side settings/configurations and have no visibility and access to the pgpool.conf file, Since the utility can be used to connect to any local or remote pgpool server, So pcp utilities always try to connect on the default socket directory and default port unless explicitly specified in the command's argument.


2016-08-30 00:25

reporter   ~0001031


how can I specify the port and the socket directory when execute PCP utilities?

Muhammad Usama

2016-08-30 00:31

developer   ~0001032

When using unix domin sockets hostname (-h) is used to specify the socket directory

For example:
# with pcp_port = 9898 and pcp_socket_dir = '/var/run/pgpool'
pcp_pool_status -h /var/run/pgpool -p 9898 -U <user>


2016-08-30 00:37

reporter   ~0001033

The --help switch says -h parameter is used to pass the hostname but not directory. Is it ok?

# pcp_watchdog_info --help
pcp_watchdog_info - display a pgpool-II watchdog's information
pcp_watchdog_info [OPTION...] [watchdog-id]
  -U, --username=NAME username for PCP authentication
  -h, --host=HOSTNAME pgpool-II host
  -p, --port=PORT PCP port number
  -w, --no-password never prompt for password
  -W, --password force password prompt (should happen automatically)
  -n, --watchdog-id=ID ID of a other pgpool to get information for
                         ID 0 for the local watchdog
                         If omitted then get information of all watchdog nodes
  -d, --debug enable debug message (optional)
  -v, --verbose output verbose messages
  -?, --help print this help

When I pass the socket dir I receive an error:
ERROR: could not retrieve hostname. gethostbyname failed with error "SUCCESS"


2016-08-30 00:38

reporter   ~0001034

...I could pass the "localhost" like #pcp_watchdog_info -h localhost ..

Muhammad Usama

2016-08-30 00:54

developer   ~0001035

You are right the --help needs a better description

And regarding as error: what version of pgpool-II you are using. Can you paste the complete command that produces an error. I just checked it again and it works fine.

[usama@localhost bin]$ ./pcp_watchdog_info -h /home/usama/work/installed/pgpool -p 9891 -U postgres 1
ERROR: PCP: informing watchdog info failed
DETAIL: watcdhog is not enabled
[usama@localhost bin]$ ./pcp_node_info -h /home/usama/work/installed/pgpool -p 9891 -U postgres 1
Password: 5434 2 0.333333 up


2016-08-30 01:45

reporter   ~0001036

Here I see some strange behavior.
If I call # pcp_watchdog_info -h /var/run/pgpool utils using command line then it works OK. But is call it using sh file then I receive the error:
 ERROR: could not retrieve hostname. gethostbyname failed with error "SUCCESS"

The version number which I use is:
$ pgpool --version
pgpool-II version 3.6-alpha1 (subaruboshi)

Finally I think we will go with the solution:
# pcp_watchdog_info -h


2016-08-31 01:40

reporter   ~0001037

Thank you for the help!


2017-08-11 23:00

reporter   ~0001642

The issue is randomly reproduced in Pgpool 3.6.5:

[root@headpgpool]# pcp_watchdog_info -h
ERROR: PCP: informing watchdog info failed
DETAIL: invalid watchdog index


2017-08-11 23:02

reporter   ~0001643

Also randomly the execution of "pcp_watchdog_info" command hangs in case the pgpool cluster lost one of pgpool nodes.


2017-08-11 23:13

reporter   ~0001644

Result of the strace command for the being hanged process:
[root@headpgpool]# strace -p 11680
Process 11680 attached
connect(9, {sa_family=AF_LOCAL, sun_path="/var/run/pgpool/.s.PGPOOLWD_CMD.9000"}, 110

[root@headpgpool]# ls -lah /var/run/pgpool/.s.*
srwxr-xr-x 1 pgpool pgpool 0 Aug 11 15:44 /var/run/pgpool/.s.PGPOOLWD_CMD.9000
srwxrwxrwx 1 pgpool pgpool 0 Aug 11 15:44 /var/run/pgpool/.s.PGSQL.5432
srwxrwxrwx 1 pgpool pgpool 0 Aug 11 15:44 /var/run/pgpool/.s.PGSQL.9898

Issue History

Date Modified Username Field Change
2016-08-29 21:21 supp_k New Issue
2016-08-30 00:13 Muhammad Usama Note Added: 0001030
2016-08-30 00:25 supp_k Note Added: 0001031
2016-08-30 00:31 Muhammad Usama Note Added: 0001032
2016-08-30 00:37 supp_k Note Added: 0001033
2016-08-30 00:38 supp_k Note Added: 0001034
2016-08-30 00:54 Muhammad Usama Note Added: 0001035
2016-08-30 01:45 supp_k Note Added: 0001036
2016-08-30 07:38 t-ishii Assigned To => Muhammad Usama
2016-08-30 07:38 t-ishii Status new => assigned
2016-08-31 01:40 supp_k Note Added: 0001037
2017-08-11 23:00 supp_k Note Added: 0001642
2017-08-11 23:02 supp_k Note Added: 0001643
2017-08-11 23:13 supp_k Note Added: 0001644