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

Commit800131d

Browse files
committed
Default to wal_sync_method=fdatasync on FreeBSD.
FreeBSD 13 gained O_DSYNC, which would normally cause wal_sync_method tochoose open_datasync as its default value. That may not be a goodchoice for all systems, and performs worse than fdatasync in somescenarios. Let's preserve the existing default behavior for now.Like commit576477e, which did the same for Linux, back-patch to allsupported releases.Discussion:https://postgr.es/m/CA%2BhUKGLsAMXBQrCxCXoW-JsUYmdOL8ALYvaX%3DCrHqWxm-nWbGA%40mail.gmail.com
1 parent4b426f7 commit800131d

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2537,8 +2537,8 @@ include_dir 'conf.d'
25372537
The <literal>open_</>* options also use <literal>O_DIRECT</> if available.
25382538
Not all of these choices are available on all platforms.
25392539
The default is the first method in the above list that is supported
2540-
by the platform, except that <literal>fdatasync</> is the default on
2541-
Linux. The default is not necessarily ideal; it might be
2540+
by the platform, except that <literal>fdatasync</literal> is the default on
2541+
Linux and FreeBSD. The default is not necessarily ideal; it might be
25422542
necessary to change this setting or other aspects of your system
25432543
configuration in order to create a crash-safe configuration or
25442544
achieve optimal performance.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
#wal_sync_method = fsync# the default is the first option
188188
# supported by the operating system:
189189
# open_datasync
190-
# fdatasync (default on Linux)
190+
# fdatasync (default on Linux and FreeBSD)
191191
# fsync
192192
# fsync_writethrough
193193
# open_sync

‎src/include/port/freebsd.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
/* src/include/port/freebsd.h */
2+
3+
/*
4+
* Set the default wal_sync_method to fdatasync. xlogdefs.h's normal rules
5+
* would prefer open_datasync on FreeBSD 13+, but that is not a good choice on
6+
* many systems.
7+
*/
8+
#ifdefHAVE_FDATASYNC
9+
#definePLATFORM_DEFAULT_SYNC_METHODSYNC_METHOD_FDATASYNC
10+
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp