Re: abstract Unix-domain sockets

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: abstract Unix-domain sockets
Date: 2020-11-20 15:06:43
Message-ID: 3f24e287-846f-b4c6-f9a4-6a776a72419e@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-11-18 04:35, David G. Johnston wrote:
> Given that "port" is a postgresql.conf setting its use here (and
> elsewhere) should be taken to mean the value of that specific variable.
> To that end, I find the current description of port to be lacking - it
> should mention its usage as a qualifier when dealing with unix socket
> files (in addition to the existing wording under unix_socket_directories).
>
> If we are going to debate semantics here "bind unix address" doesn't
> seem correct.  could not create Unix socket file /tmp/.s.PGSQL.5432, it
> already exists.
>
> The hint would be better written: Is another postmaster running with
> unix_socket_directories = /tmp and port = 5432?  If not, remove the unix
> socket file /tmp/.s.PGSQL.5432 and retry.
>
> I don't see much benefit in trying to share logic/wording between the
> various messages and hints for the different ways the server can
> establish communication points.
>
> I agree that there isn't a useful hint for the abstract case as it
> shouldn't happen unless there is indeed another running instance with
> the same configuration.  Though a hint similar to the above, but without
> the "remove and retry" bit, probably wouldn't hurt.

I think we are getting a bit sidetracked here with the message wording.
The reason I looked at this was that "remove socket file and retry" is
never an appropriate action with abstract sockets. And on further
analysis, it is never an appropriate action with any Unix-domain socket
(because with file system namespace sockets, you never get an
EADDRINUSE, so it's dead code). So my proposal here is to just delete
that line from the hint and leave the rest the same. There could be
value in further refining and rephrasing this, but it ought to be a
separate thread.

--
Peter Eisentraut
2ndQuadrant, an EDB company
https://www.2ndquadrant.com/

Attachment Content-Type Size
v3-0001-Add-support-for-abstract-Unix-domain-sockets.patch text/plain 10.4 KB
v3-0002-Make-error-hint-from-bind-failure-more-accurate.patch text/plain 2.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2020-11-20 15:14:49 Re: Removal of currtid()/currtid2() and some table AM cleanup
Previous Message Fabien COELHO 2020-11-20 14:54:24 Re: parsing pg_ident.conf