You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Try to avoid semaphore-related test failures on NetBSD/OpenBSD.
These two platforms have a remarkably tight default limit on the
number of SysV semaphores in the system: SEMMNS is only 60
out-of-the-box. Unless manual action is taken to raise that,
we'll only be able to allocate 3 sets of 16 usable semaphores
each, leading to initdb setting max_connections to just 20.
That's problematic because the core regression tests expect
to be able to launch 20 concurrent sessions, leaving us with
no headroom. This seems to be the cause of intermittent
buildfarm failures on some machines.
While there's no getting around the fact that you'd better raise
SEMMNS for production use on these platforms, it does seem desirable
for "make check" to pass reliably without that. We can make that
happen, at least for awhile longer, with two small changes:
* Change sysv_sema.c's SEMAS_PER_SET to 19, so that we can eat up
all of the available semas not just most of them.
* Change initdb to make the smallest max_connections value it will
consider be 25 not 20.
This is a back-patch of recent HEAD commit 38da053 into v17.
The motivation for doing this now is that an upcoming bug-fix
patch will give the new-in-17 slotsync worker process its own
reserved PGPROC and hence also semaphore. With that patch but
without this change, v17 would fail to start at all under the
default SEMMNS on these platforms.
Discussion: https://postgr.es/m/db2773a2-aca0-43d0-99c1-060efcd9954e@gmail.com
Discussion: https://postgr.es/m/1808397.1735156190@sss.pgh.pa.us
Copy file name to clipboardExpand all lines: doc/src/sgml/runtime.sgml
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -781,19 +781,19 @@ psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such
781
781
<row>
782
782
<entry><varname>SEMMNI</varname></entry>
783
783
<entry>Maximum number of semaphore identifiers (i.e., sets)</entry>
784
-
<entry>at least <literal>ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 7) / 16)</literal> plus room for other applications</entry>
784
+
<entry>at least <literal>ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 7) / 19)</literal> plus room for other applications</entry>
785
785
</row>
786
786
787
787
<row>
788
788
<entry><varname>SEMMNS</varname></entry>
789
789
<entry>Maximum number of semaphores system-wide</entry>
790
-
<entry><literal>ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 7) / 16) * 17</literal> plus room for other applications</entry>
790
+
<entry><literal>ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 7) / 19) * 20</literal> plus room for other applications</entry>
791
791
</row>
792
792
793
793
<row>
794
794
<entry><varname>SEMMSL</varname></entry>
795
795
<entry>Maximum number of semaphores per set</entry>
796
-
<entry>at least 17</entry>
796
+
<entry>at least 20</entry>
797
797
</row>
798
798
799
799
<row>
@@ -840,20 +840,20 @@ psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such
840
840
(<xref linkend="guc-max-connections"/>), allowed autovacuum worker process
841
841
(<xref linkend="guc-autovacuum-max-workers"/>), allowed WAL sender process
842
842
(<xref linkend="guc-max-wal-senders"/>), and allowed background
843
-
process (<xref linkend="guc-max-worker-processes"/>), in sets of 16.
843
+
process (<xref linkend="guc-max-worker-processes"/>), in sets of 19.
844
844
Each such set will
845
-
also contain a 17th semaphore which contains a <quote>magic
845
+
also contain a 20th semaphore which contains a <quote>magic
846
846
number</quote>, to detect collision with semaphore sets used by
847
847
other applications. The maximum number of semaphores in the system
848
848
is set by <varname>SEMMNS</varname>, which consequently must be at least
849
849
as high as <varname>max_connections</varname> plus
850
850
<varname>autovacuum_max_workers</varname> plus <varname>max_wal_senders</varname>,
851
-
plus <varname>max_worker_processes</varname>, plus one extra for each 16
851
+
plus <varname>max_worker_processes</varname>, plus one extra for each 19
852
852
allowed connections plus workers (see the formula in <xref
853
853
linkend="sysvipc-parameters"/>). The parameter <varname>SEMMNI</varname>
854
854
determines the limit on the number of semaphore sets that can
855
855
exist on the system at one time. Hence this parameter must be at
0 commit comments