aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2010-06-29 18:44:58 +0000
committerBruce Momjian <bruce@momjian.us>2010-06-29 18:44:58 +0000
commitb57ddccf05039bc511e7c4eb3b23933126441bac (patch)
tree8085aa1935bd5b95ff427919a03ab9a4e63d336e /src
parent89474cc321bc7af4f02884a9f69539db38dc12c2 (diff)
downloadpostgresql-b57ddccf05039bc511e7c4eb3b23933126441bac.tar.gz
postgresql-b57ddccf05039bc511e7c4eb3b23933126441bac.zip
Add C comment about why synchronous_commit=off behavior can lose
committed transactions in a postmaster crash.
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/transam/xact.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index 8f2a3ed5e4f..d97b75ab96e 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.291 2010/05/13 11:39:30 sriggs Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.292 2010/06/29 18:44:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1028,7 +1028,7 @@ RecordTransactionCommit(void)
if (XactSyncCommit || forceSyncCommit || haveNonTemp)
{
/*
- * Synchronous commit case.
+ * Synchronous commit case:
*
* Sleep before flush! So we can flush more than one commit records
* per single fsync. (The idea is some other backend may do the
@@ -1054,7 +1054,12 @@ RecordTransactionCommit(void)
else
{
/*
- * Asynchronous commit case.
+ * Asynchronous commit case:
+ *
+ * This enables possible committed transaction loss in the case of a
+ * postmaster crash because WAL buffers are left unwritten.
+ * Ideally we could issue the WAL write without the fsync, but
+ * some wal_sync_methods do not allow separate write/fsync.
*
* Report the latest async commit LSN, so that the WAL writer knows to
* flush this commit.