1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

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.
This commit is contained in:
Tom Lane
2007-08-01 22:45:09 +00:00
parent c722628a43
commit 4a78cdeb6b
25 changed files with 998 additions and 303 deletions

View File

@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.48 2007/06/07 19:19:56 tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.49 2007/08/01 22:45:08 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -354,6 +354,14 @@ CreateTableSpace(CreateTableSpaceStmt *stmt)
(void) XLogInsert(RM_TBLSPC_ID, XLOG_TBLSPC_CREATE, rdata);
}
/*
* Force synchronous commit, to minimize the window between creating
* the symlink on-disk and marking the transaction committed. It's
* not great that there is any window at all, but definitely we don't
* want to make it larger than necessary.
*/
ForceSyncCommit();
pfree(linkloc);
pfree(location);
@ -480,6 +488,14 @@ DropTableSpace(DropTableSpaceStmt *stmt)
* entries for relations in the tablespace.
*/
/*
* Force synchronous commit, to minimize the window between removing
* the files on-disk and marking the transaction committed. It's
* not great that there is any window at all, but definitely we don't
* want to make it larger than necessary.
*/
ForceSyncCommit();
/*
* Allow TablespaceCreateDbspace again.
*/