diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-02-18 04:50:43 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-02-18 04:50:43 +0000 |
commit | 57e084718097bd03598a3db8c06b3ba72670737d (patch) | |
tree | 164c209835d2c41da3ef69a5de9173fc03065a15 /src/backend/access/transam/xact.c | |
parent | 33cc5d8a4d0dd7cdf78c6a6851b37799854191d4 (diff) | |
download | postgresql-57e084718097bd03598a3db8c06b3ba72670737d.tar.gz postgresql-57e084718097bd03598a3db8c06b3ba72670737d.zip |
Change default commit_delay to zero, update documentation.
Diffstat (limited to 'src/backend/access/transam/xact.c')
-rw-r--r-- | src/backend/access/transam/xact.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index 9172f121d1a..37eee5ebfd7 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.96 2001/01/24 19:42:51 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.97 2001/02/18 04:50:43 tgl Exp $ * * NOTES * Transaction aborts can now occur two ways: @@ -221,7 +221,7 @@ int XactIsoLevel; #include "access/xlogutils.h" -int CommitDelay = 5; /* 1/200000 sec */ +int CommitDelay = 0; /* in microseconds */ static void (*_RollbackFunc)(void*) = NULL; static void *_RollbackData = NULL; @@ -667,7 +667,6 @@ RecordTransactionCommit() { XLogRecData rdata; xl_xact_commit xlrec; - struct timeval delay; XLogRecPtr recptr; BufmgrCommit(); @@ -686,11 +685,20 @@ RecordTransactionCommit() /* * Sleep before commit! So we can flush more than one - * commit records per single fsync. + * commit records per single fsync. (The idea is some other + * backend may do the XLogFlush while we're sleeping. This + * needs work however, because on most Unixen, the minimum + * select() delay is 10msec or more, which is way too long.) */ - delay.tv_sec = 0; - delay.tv_usec = CommitDelay; - (void) select(0, NULL, NULL, NULL, &delay); + if (CommitDelay > 0) + { + struct timeval delay; + + delay.tv_sec = 0; + delay.tv_usec = CommitDelay; + (void) select(0, NULL, NULL, NULL, &delay); + } + XLogFlush(recptr); MyLastRecPtr.xrecoff = 0; |