[pgpool-hackers: 1701] Re: pcp_socket_dir?

Muhammad Usama m.usama at gmail.com
Thu Jul 14 21:48:48 JST 2016


Hi Ishii-San

Thanks for your input. It appears that the problem was caused by my commit
:-(
I have pushed the fixes.

http://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=680e3297f1d6c58810889ccf54a0614617739e7b

Regards
Muhammad Usama

On Thu, Jul 14, 2016 at 10:12 AM, Tatsuo Ishii <ishii at postgresql.org> wrote:

> [Subject changed due to different topic]
>
> PCP's_socket_dir has been there until pgpool-II 3.4.
>
> From pgpool-II 3.5 it was removed by this commit:
>
>
> https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commitdiff;h=e95c05b06283ec4c801f3ecd0f1d182ca10913cd
>
> My guess is, this was just a mistake.
>
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp
>
> > 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
> >> >> _______________________________________________
> >
> > _______________________________________________
> > pgpool-hackers mailing list
> > pgpool-hackers at pgpool.net
> > http://www.pgpool.net/mailman/listinfo/pgpool-hackers
> _______________________________________________
> pgpool-hackers mailing list
> pgpool-hackers at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-hackers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20160714/4c671ccf/attachment.html>


More information about the pgpool-hackers mailing list