pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Set max_safe_fds whenever we create shared memory and semaphores
Date: Tue, 17 Dec 2024 17:23:35 +0000
Message-ID: <E1tNbIF-000453-7l@gemulon.postgresql.org> (raw)

Set max_safe_fds whenever we create shared memory and semaphores.

Formerly we skipped this in bootstrap/check mode and in single-user
mode.  That's bad in check mode because it may allow accepting a
value of max_connections that doesn't actually work: on platforms
where semaphores consume file descriptors, there may not be enough
free FDs left over to satisfy fd.c, causing postmaster start to
fail.  It's also not great in single-user mode, because fd.c will
operate with just the minimum allowable value of max_safe_fds,
resulting in excess file open/close overhead if anything moderately
complicated is done in single-user mode.  (There may be some penalty
for bootstrap mode too, though probably not much.)

Discussion: https://postgr.es/m/2081982.1734393311@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/21fb39cb07938d29f2c7cfcf627d1b3d6b48e61c

Modified Files
--------------
src/backend/bootstrap/bootstrap.c |  6 ++++++
src/backend/tcop/postgres.c       | 10 ++++++++++
2 files changed, 16 insertions(+)



Message-ID: <E1tNbIF-000453-7l@gemulon.postgresql.org>
Permalink:  ../E1tNbIF-000453-7l@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tNbIF-000453-7l@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Set max_safe_fds whenever we create shared memory and semaphores
  In-Reply-To: <E1tNbIF-000453-7l@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox