[pgpool-hackers: 1697] Re: [pgpool/pgpool2] [v3.5.3] PCP options from pgpool.conf not being used (#4)

TAKATSUKA Haruka harukat at sraoss.co.jp
Thu Jul 14 11:57:26 JST 2016


Hello, pgpool-hackers

There are no code to handle "pcp_socket_dir" in
src/config/pool_config.l:pool_get_config() of pgpool-II 3.5.3,
but the code to handle "socket_dir" appears twice.

regards,
TAKATSUKA Haruka / harukat @ sraoss.co.jp


On Thu, 14 Jul 2016 07:59:20 +0900 (JST)
Tatsuo Ishii <ishii at postgresql.org> wrote:

> pcp_listen_addresses was added by this commit toward pgpool-II 3.4 on 2014/04/10:
> 
> https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=d87e2706b88558321b2ad287374149d5ba15c3af
> 
> The particlular potion of the code to handle pcp_listen_addresses is in src/main/main.c:
> 
> diff --git a/src/main/main.c b/src/main/main.c
> index b826dea..027bdb4 100644 (file)
> --- a/src/main/main.c
> +++ b/src/main/main.c
> @@ -654,8 +654,11 @@ int main(int argc, char **argv)
>  
>         /* fork a child for PCP handling */
>         pcp_unix_fd = create_unix_domain_socket(pcp_un_addr);
> -    /* maybe change "*" to pool_config->pcp_listen_addresses */
> -       pcp_inet_fd = create_inet_domain_socket("*", pool_config->pcp_port);
> +
> +       if (pool_config->pcp_listen_addresses[0])
> +       {
> +               pcp_inet_fd = create_inet_domain_socket(pool_config->pcp_listen_addresses, pool_config->pcp_port);
> +       }
>         pcp_pid = pcp_fork_a_child(pcp_unix_fd, pcp_inet_fd, pcp_conf_file);
>  
>         /* Fork worker process */
> 
> Then removed by this commit on 2014/04/28:
> 
> https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=cdb49d3b783c03a7394e191e86763f364c7c6ce6
> 
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp
> 
> > Hi Ishii-San
> > While looking at the code for this bug report I found out that pgpool
> > always bind the PCP listening socket to all addresses and ignore
> > "pcp_listen_addresses" configuration
> > 
> > Snippet of related code in file:pgpool_main.c
> > 
> > /* maybe change "*" to pool_config->pcp_listen_addresses */
> > pcp_inet_fd = create_inet_domain_socket("*", pool_config->pcp_port);
> > 
> > Do you remember any particular reason for that? Since this code same since
> > the very beginning
> > 
> > 
> > Regards
> > Muhamamd Usama
> > 
> > 
> > On Wed, Jul 13, 2016 at 6:46 AM, Tatsuo Ishii <ishii at postgresql.org> wrote:
> > 
> >> Usama,
> >>
> >> Recently an issue regarding pcp command has been posted to our
> >> official pgpool-II mirror at GitHub.  Can you please take a look at
> >> it?
> >>
> >> https://github.com/pgpool/pgpool2/issues/4
> >> --
> >> Tatsuo Ishii
> >> SRA OSS, Inc. Japan
> >> English: http://www.sraoss.co.jp/index_en.php
> >> Japanese:http://www.sraoss.co.jp
> >>
> >> From: Zachary Sheets <notifications at github.com>
> >> Subject: [pgpool/pgpool2] [v3.5.3] PCP options from pgpool.conf not being
> >> used (#4)
> >> Date: Tue, 12 Jul 2016 12:38:17 -0700
> >> Message-ID: <pgpool/pgpool2/issues/4 at github.com>
> >>
> >> > OS: ArchLinux
> >> > Kernel: 4.6.4-GrSec
> >> > PgSQL: 9.5.3
> >> > PgPool-II: 3.5.3
> >> >
> >> > Compile-time options:
> >> > ``` bash
> >> > ./configure \
> >> >     --prefix=/usr \
> >> >     --with-openssl \
> >> >     --sysconfdir=/etc/pgpool \
> >> >     --mandir=/usr/share/man
> >> > ```
> >> >
> >> > pgpool.conf (relevant options):
> >> > ``` bash
> >> > # ...
> >> > socket_dir = '/run/postgresql'
> >> > # ...
> >> > pcp_listen_addresses = ''
> >> > pcp_port = 9090
> >> > pcp_socket_dir = '/run/postgresql'
> >> > # ...
> >> > wd_ipc_socket_dir = '/run/postgresql'
> >> > # ...
> >> > ```
> >> >
> >> > This file should be in ```/run/postgresql```, not in ```/tmp```:
> >> > ``` bash
> >> > # ls -lAt /tmp
> >> > total 0
> >> > srwxrwxrwx 1 root root  0 Jul 12 15:17 .s.PGSQL.9090
> >> > ```
> >> >
> >> > The PCP service should not be listening on *any* address, let alone
> >> *every* address.
> >> > ``` bash
> >> > # ss -lnt | grep ':9090'
> >> > LISTEN     0      48           *:9090                     *:*
> >> > ```
> >> >
> >> > The ```pcp_pool_status``` tool is, according to documentation, supposed
> >> to be using the same ```pgpool.conf``` file as the main service. It either
> >> is not, or has its values hardcoded. No option is listed in the
> >> documentation to use a specific configuration file.
> >> > ``` bash
> >> > # pcp_pool_status -U <user>
> >> > ERROR: connection to socket "/tmp/.s.PGSQL.9898" failed with error "No
> >> such file or directory"
> >> > ```
> >> >
> >> > ---
> >> > You are receiving this because you are subscribed to this thread.
> >> > Reply to this email directly or view it on GitHub:
> >> > https://github.com/pgpool/pgpool2/issues/4
> >> _______________________________________________



More information about the pgpool-hackers mailing list