1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Give up on running with NetBSD/OpenBSD's default semaphore settings.

This reverts commit 38da053463, which
attempted to preserve our ability to start with only 60 semaphores.

Subsequent changes (particularly 55b454d0e) have put that idea pretty
much permanently out of reach: people wishing to use Postgres v18 on
OpenBSD or NetBSD will have no choice but to increase those platforms'
default values of SEMMNI and SEMMNS.

Hence, revert 38da05346's changes in SEMAS_PER_SET and the minimum
tested value of max_connections.  Adjust a comment from the subsequent
patch 6d0154196, and tweak the wording in runtime.sgml to make it
clear that changing SEMMNI/SEMMNS is no longer even a little bit
optional on these platforms.

Although 38da05346 was later back-patched into v17, leave that branch
alone: it's still capable of starting with 60 semaphores, and there's
no reason to break that.

Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Discussion: https://postgr.es/m/E1tuZNv-0037Gs-34@gemulon.postgresql.org
Discussion: https://postgr.es/m/1052019.1745947915@sss.pgh.pa.us
This commit is contained in:
Tom Lane
2025-04-29 17:27:52 -04:00
parent e974f1c216
commit 810a8b1c80
3 changed files with 17 additions and 24 deletions

View File

@ -50,14 +50,8 @@ typedef int IpcSemaphoreId; /* semaphore ID returned by semget(2) */
* we allocate. It must be *less than* your kernel's SEMMSL (max semaphores
* per set) parameter, which is often around 25. (Less than, because we
* allocate one extra sema in each set for identification purposes.)
*
* The present value of 19 is chosen with one eye on NetBSD/OpenBSD's default
* SEMMNS setting of 60. Remembering the extra sema per set, this lets us
* allocate three sets with 57 useful semaphores before exceeding that, which
* is enough to run our core regression tests. Users of those systems will
* still want to raise SEMMNS for any sort of production work, though.
*/
#define SEMAS_PER_SET 19
#define SEMAS_PER_SET 16
#define IPCProtection (0600) /* access/modify by user only */

View File

@ -1128,15 +1128,14 @@ test_config_settings(void)
* for a given max_connections value. Note that it has been carefully
* crafted to provide specific values for the associated values in
* trial_conns. We want it to return autovacuum_worker_slots's initial
* default value (16) for the maximum value in trial_conns (100), and we
* want it to return close to the minimum value we'd consider (3, which is
* the default of autovacuum_max_workers) for the minimum value in
* trial_conns (25).
* default value (16) for the maximum value in trial_conns[] (100), while
* it mustn't return less than the default value of autovacuum_max_workers
* (3) for the minimum value in trial_conns[].
*/
#define AV_SLOTS_FOR_CONNS(nconns) ((nconns) / 6)
static const int trial_conns[] = {
100, 50, 40, 30, 25
100, 50, 40, 30, 20
};
static const int trial_bufs[] = {
16384, 8192, 4096, 3584, 3072, 2560, 2048, 1536,