[pgpool-hackers: 1196] Re: Problem with pcp's UNIX domain socket

Tatsuo Ishii ishii at postgresql.org
Wed Dec 9 09:15:28 JST 2015


Devrim,

Thanks for the info. I didn't notice that since PostgreSQL 9.3,
PostgreSQL accepts multiple UNIX domain socket directories.

Also I didn't notice that PostgreSQL RPM based installation accepts
multiple UNIX domain socket directories, /tmp and /var/run/postgresql.
Last time I tried with RPM based installation on CentOS7, it did not
create a socket under /tmp, but it is possible that this is my
mistake. Let me check again.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp

> Hi,
> 
> http://git.postgresql.org/gitweb/?p=pgrpms.git;a=blob_plain;f=rpm/redhat/9.5/postgresql/EL-7/postgresql-var-run-socket.patch;hb=HEAD
> 
> is the patch we add to RPMs, and it includes a comment that explains the reason for it.
> 
> Regards,
> 
> On December 8, 2015 12:54:00 PM GMT+02:00, Muhammad Usama <m.usama at gmail.com> wrote:
>>On Tue, Dec 8, 2015 at 2:02 PM, Tatsuo Ishii <ishii at postgresql.org>
>>wrote:
>>
>>> > Hi Ishii San
>>> >
>>> > I don't think that PCP client side is required to recognize the
>>> > *pcp_socket_dir*, one because *pcp_socket_dir* only sets the
>>directory
>>> > where the PCP server in pgpool-II would create the unix domain
>>socket
>>> file.
>>> > And to connect to PCP server using the unix domain socket, pcp_*
>>clients
>>> > needs to provide that path in hostname option of the command
>>> >
>>> > For example, if pcp_socket_dir = '/tmp' the client can put this
>>> pcp_socket_dir
>>> > path in -h command line argument of pcp_* commands
>>> >
>>> > $ bin/pcp_watchdog_info -h  /tmp/ -U postgres -v 0
>>>
>>> Ok, that makes sense.
>>>
>>> > Secondly, pcp_* frontend clients have no dependency on and
>>visibility
>>> > of pgpool.conf file, so they have no idea about pcp_socket_dir
>>value.
>>>
>>> This is questionable if we think about how PostgreSQL's libpq clients
>>> behaves. For example, on RHEL6 psql included in the official
>>> PostgreSQL rpm connects to UNIX domain socket under /tmp/ by default.
>>> However, on RHEL7, psql connects to UNIX domain socket under
>>> /var/lib/pgsql by default. So surely PostgreSQL clients has an idea
>>> about UNIX domain socket directory. Shouldn't we follow the
>>> PostgreSQL's way?
>>>
>>
>>Please correct me if I am wrong. But I think libpq clients on RHEL7 and
>>RHEL6 only have different default values for the socket directory and
>>are
>>not dependent on value of *unix_socket_directories* configuration
>>parameter defined in postgresql.conf file.
>>
>>I am not sure, but I think the rpm build system on RHEL7 and RHEL6
>>might be
>>changing the value of DEFAULT_PGSOCKET_DIR define
>>in include/pg_config_manual.h before making the build to get the
>>desired
>>default socket directory values. And if we want to follow the
>>PostgreSQL's
>>way we can do the same by changing the UNIX_DOMAIN_PATH define in
>>pcp_stream.h before building the rpm for the respective system.
>>
>>Thanks
>>Best regards
>>Muhammad Usama
>>
>>
>>
>>>
>>> > Thanks
>>> > Best regards
>>> > Muhammad Usama
>>> >
>>> >
>>> > On Tue, Dec 8, 2015 at 9:40 AM, Tatsuo Ishii <ishii at postgresql.org>
>>> wrote:
>>> >
>>> >> Usama,
>>> >>
>>> >> Does pcp recognize pcp_socket_dir? While searching libc/pcp.c, I
>>could
>>> >> not find any reference to pcp_socket_dir.
>>> >>
>>> >> Best regards,
>>> >> --
>>> >> Tatsuo Ishii
>>> >> SRA OSS, Inc. Japan
>>> >> English: http://www.sraoss.co.jp/index_en.php
>>> >> Japanese:http://www.sraoss.co.jp
>>> >> _______________________________________________
>>> >> 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
> 
> -- 
> Sent from my Android device with K-9 Mail. Please excuse my brevity.


More information about the pgpool-hackers mailing list