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

Commit6c23e5a

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 parent9fe4091 commit6c23e5a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2853,7 +2853,7 @@ include_dir 'conf.d'
28532853
Not all of these choices are available on all platforms.
28542854
The default is the first method in the above list that is supported
28552855
by the platform, except that <literal>fdatasync</literal> is the default on
2856-
Linux. The default is not necessarily ideal; it might be
2856+
Linux and FreeBSD. The default is not necessarily ideal; it might be
28572857
necessary to change this setting or other aspects of your system
28582858
configuration in order to create a crash-safe configuration or
28592859
achieve optimal performance.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
#wal_sync_method = fsync# the default is the first option
204204
# supported by the operating system:
205205
# open_datasync
206-
# fdatasync (default on Linux)
206+
# fdatasync (default on Linux and FreeBSD)
207207
# fsync
208208
# fsync_writethrough
209209
# 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