Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita2b0719

Browse files
committed
Default to dynamic_shared_memory_type=sysv on Solaris.
POSIX shm_open() can sleep for a long time and fail spuriously becauseof contention on an internal lock file on Solaris (and presumablyillumos). Commit389869a fixed the main problem with this, namely thatwe could crash, but it's now clear that "posix" is not a good default.Therefore, choose "sysv" at initdb time on Solaris and illumos. Otherchoices are still available by editing the postgresql.conf file.Back-patch only to 15, because contention is much less likely furtherback, and it doesn't seem like a good idea to change this in releasedbranches. This should clear up the failures on build farm animalmargay.Discussion:https://postgr.es/m/CA%2BhUKGKqKrCV5xKWfh9rnm%3Do%3DDwZLTLtnsj_XpUi9g5%3DV%2B9oyg%40mail.gmail.com
1 parent0806cd2 commita2b0719

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2036,7 +2036,7 @@ include_dir 'conf.d'
20362036
and <literal>mmap</literal> (to simulate shared memory using
20372037
memory-mapped files stored in the data directory).
20382038
Not all values are supported on all platforms; the first supported
2039-
option is the default for that platform. The use of the
2039+
option isusuallythe default for that platform. The use of the
20402040
<literal>mmap</literal> option, which is not the default on any platform,
20412041
is generally discouraged because the operating system may write
20422042
modified pages back to disk repeatedly, increasing system I/O load;

‎src/backend/utils/misc/postgresql.conf.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
# sysv
148148
# windows
149149
# (change requires restart)
150-
#dynamic_shared_memory_type = posix# the default is the first option
150+
#dynamic_shared_memory_type = posix# the default isusuallythe first option
151151
# supported by the operating system:
152152
# posix
153153
# sysv

‎src/bin/initdb/initdb.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,11 +842,14 @@ set_null_conf(void)
842842
* segment in dsm_impl.c; if it doesn't work, we assume it won't work for
843843
* the postmaster either, and configure the cluster for System V shared
844844
* memory instead.
845+
*
846+
* We avoid choosing Solaris's implementation of shm_open() by default. It
847+
* can sleep and fail spuriously under contention.
845848
*/
846849
staticconstchar*
847850
choose_dsm_implementation(void)
848851
{
849-
#ifdefHAVE_SHM_OPEN
852+
#if defined(HAVE_SHM_OPEN)&& !defined(__sun__)
850853
intntries=10;
851854
pg_prng_stateprng_state;
852855

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp