aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/misc
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-08-01 22:45:09 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-08-01 22:45:09 +0000
commit4a78cdeb6b598940e9d9adb92deca6494628802a (patch)
tree0c8ad45eea297dcbc647705265eab8188fd4d8b1 /src/backend/utils/misc
parentc722628a430f347ff4a30419004cddc9795a3bb6 (diff)
downloadpostgresql-4a78cdeb6b598940e9d9adb92deca6494628802a.tar.gz
postgresql-4a78cdeb6b598940e9d9adb92deca6494628802a.zip
Support an optional asynchronous commit mode, in which we don't flush WAL
before reporting a transaction committed. Data consistency is still guaranteed (unlike setting fsync = off), but a crash may lose the effects of the last few transactions. Patch by Simon, some editorialization by Tom.
Diffstat (limited to 'src/backend/utils/misc')
-rw-r--r--src/backend/utils/misc/guc.c14
-rw-r--r--src/backend/utils/misc/postgresql.conf.sample1
2 files changed, 12 insertions, 3 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index b2d0ea9cae5..c30d8b50a05 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.407 2007/07/24 04:54:09 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.408 2007/08/01 22:45:09 tgl Exp $
*
*--------------------------------------------------------------------
*/
@@ -554,6 +554,14 @@ static struct config_bool ConfigureNamesBool[] =
true, NULL, NULL
},
{
+ {"synchronous_commit", PGC_USERSET, WAL_SETTINGS,
+ gettext_noop("Sets immediate fsync at commit."),
+ NULL
+ },
+ &XactSyncCommit,
+ true, NULL, NULL
+ },
+ {
{"zero_damaged_pages", PGC_SUSET, DEVELOPER_OPTIONS,
gettext_noop("Continues processing past damaged page headers."),
gettext_noop("Detection of a damaged page header normally causes PostgreSQL to "
@@ -1521,7 +1529,7 @@ static struct config_int ConfigureNamesInt[] =
},
{
- {"commit_delay", PGC_USERSET, WAL_CHECKPOINTS,
+ {"commit_delay", PGC_USERSET, WAL_SETTINGS,
gettext_noop("Sets the delay in microseconds between transaction commit and "
"flushing WAL to disk."),
NULL
@@ -1531,7 +1539,7 @@ static struct config_int ConfigureNamesInt[] =
},
{
- {"commit_siblings", PGC_USERSET, WAL_CHECKPOINTS,
+ {"commit_siblings", PGC_USERSET, WAL_SETTINGS,
gettext_noop("Sets the minimum concurrent open transactions before performing "
"commit_delay."),
NULL
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index 8bfad997ff3..c87e4baf43d 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -149,6 +149,7 @@
# - Settings -
#fsync = on # turns forced synchronization on or off
+#synchronous_commit = on # immediate fsync at commit
#wal_sync_method = fsync # the default is the first option
# supported by the operating system:
# open_datasync