Re: Document that server will start even if it's unable to open some TCP/IP ports

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: nathandbossart(at)gmail(dot)com
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, gurjeet(at)singh(dot)im, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Document that server will start even if it's unable to open some TCP/IP ports
Date: 2023-06-14 02:56:35
Message-ID: 20230614.115635.2291203033279171356.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Tue, 13 Jun 2023 14:38:14 -0700, Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote in
> On Tue, Jun 13, 2023 at 04:28:31PM -0400, Tom Lane wrote:
> > Nathan Bossart <nathandbossart(at)gmail(dot)com> writes:
> >> Before we spend too much time trying to document the current behavior, I
> >> think we should see if we can change it to something less surprising (i.e.,
> >> failing to start if the server fails for any address). The original
> >> objections around kernel support for IPv6 might no longer stand.
> >
> > I think that'd be more surprising not less.
>
> The reason it surprises me is because it creates uncertainty about the
> server configuration. Granted, I could look in the logs for any warnings,
> but I'm not sure that's the best experience. I would expect this to work
> more like huge_pages. If I set huge_pages to "on", I know that the server
> is using huge pages if it starts up.
>
> > The systemd guys certainly believe that daemons ought to auto-adapt
> > to changes in the machine's internet connectivity. We aren't there
> > yet, but I can imagine somebody trying to fix that someday soon.
> > If the postmaster is able to dynamically acquire and drop ports then
> > it would certainly not make sense to behave as you suggest.
>
> Agreed, if listen_addresses became a PGC_SIGHUP parameter, it would make
> sense to avoid shutting down the server if it was dynamically
> misconfigured, as is done for the configuration files. I think that
> argument applies for changes in connectivity, too.

If I had to say, I would feel it rather surprising if server
successfully starts even when any explicitly-specified port can't be
opened (which is the current case). The current auto-adaption is fine
iff I use '*' for listen_addresses. IMHO, for "reliable"
auto-adaption, we might want '[+-]?xxx.xxx.xxx.xxx/nn' (and the same
for v6), or '[+-]?interface-name' notation to require, allow, or
disallow to use specific networks.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2023-06-14 03:08:55 Re: Views no longer in rangeTabls?
Previous Message YANG Xudong 2023-06-14 02:20:10 Re: [PATCH] Add loongarch native checksum implementation.