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

Commitb57ddcc

Browse files
committed
Add C comment about why synchronous_commit=off behavior can lose
committed transactions in a postmaster crash.
1 parent89474cc commitb57ddcc

File tree

1 file changed

+8
-3
lines changed
  • src/backend/access/transam

1 file changed

+8
-3
lines changed

‎src/backend/access/transam/xact.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.291 2010/05/13 11:39:30 sriggs Exp $
13+
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.292 2010/06/29 18:44:58 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -1028,7 +1028,7 @@ RecordTransactionCommit(void)
10281028
if (XactSyncCommit||forceSyncCommit||haveNonTemp)
10291029
{
10301030
/*
1031-
* Synchronous commit case.
1031+
* Synchronous commit case:
10321032
*
10331033
* Sleep before flush! So we can flush more than one commit records
10341034
* per single fsync. (The idea is some other backend may do the
@@ -1054,7 +1054,12 @@ RecordTransactionCommit(void)
10541054
else
10551055
{
10561056
/*
1057-
* Asynchronous commit case.
1057+
* Asynchronous commit case:
1058+
*
1059+
* This enables possible committed transaction loss in the case of a
1060+
* postmaster crash because WAL buffers are left unwritten.
1061+
* Ideally we could issue the WAL write without the fsync, but
1062+
* some wal_sync_methods do not allow separate write/fsync.
10581063
*
10591064
* Report the latest async commit LSN, so that the WAL writer knows to
10601065
* flush this commit.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp