aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer/bufmgr.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-05-31 20:31:33 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-05-31 20:31:33 +0000
commit91d20ff7aa4c61e570cf652bb3a48fd18fcf9d9d (patch)
treedce0d78c487cf062284405192f7cf221f5bfa7fb /src/backend/storage/buffer/bufmgr.c
parente674707968059459960304981fc0a1d7a6049e24 (diff)
downloadpostgresql-91d20ff7aa4c61e570cf652bb3a48fd18fcf9d9d.tar.gz
postgresql-91d20ff7aa4c61e570cf652bb3a48fd18fcf9d9d.zip
Additional mop-up for sync-to-fsync changes: avoid issuing fsyncs for
temp tables, and avoid WAL-logging truncations of temp tables. Do issue fsync on truncated files (not sure this is necessary but it seems like a good idea).
Diffstat (limited to 'src/backend/storage/buffer/bufmgr.c')
-rw-r--r--src/backend/storage/buffer/bufmgr.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index bc6c0f6993c..400fbcf1ff7 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.168 2004/05/31 19:24:05 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.169 2004/05/31 20:31:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -182,7 +182,8 @@ ReadBufferInternal(Relation reln, BlockNumber blockNum,
{
/* new buffers are zero-filled */
MemSet((char *) MAKE_PTR(bufHdr->data), 0, BLCKSZ);
- smgrextend(reln->rd_smgr, blockNum, (char *) MAKE_PTR(bufHdr->data));
+ smgrextend(reln->rd_smgr, blockNum, (char *) MAKE_PTR(bufHdr->data),
+ reln->rd_istemp);
}
else
{
@@ -915,8 +916,8 @@ BufferGetFileNode(Buffer buffer)
* NOTE: this actually just passes the buffer contents to the kernel; the
* real write to disk won't happen until the kernel feels like it. This
* is okay from our point of view since we can redo the changes from WAL.
- * However, we will need to force the changes to disk via sync/fsync
- * before we can checkpoint WAL.
+ * However, we will need to force the changes to disk via fsync before
+ * we can checkpoint WAL.
*
* BufMgrLock must be held at entry, and the buffer must be pinned. The
* caller is also responsible for doing StartBufferIO/TerminateBufferIO.
@@ -979,7 +980,8 @@ FlushBuffer(BufferDesc *buf, SMgrRelation reln)
*/
smgrwrite(reln,
buf->tag.blockNum,
- (char *) MAKE_PTR(buf->data));
+ (char *) MAKE_PTR(buf->data),
+ false);
/* Pop the error context stack */
error_context_stack = errcontext.previous;
@@ -1033,7 +1035,7 @@ RelationTruncate(Relation rel, BlockNumber nblocks)
rel->rd_targblock = InvalidBlockNumber;
/* Do the real work */
- smgrtruncate(rel->rd_smgr, nblocks);
+ smgrtruncate(rel->rd_smgr, nblocks, rel->rd_istemp);
}
/* ---------------------------------------------------------------------
@@ -1351,7 +1353,8 @@ FlushRelationBuffers(Relation rel, BlockNumber firstDelBlock)
smgrwrite(rel->rd_smgr,
bufHdr->tag.blockNum,
- (char *) MAKE_PTR(bufHdr->data));
+ (char *) MAKE_PTR(bufHdr->data),
+ true);
bufHdr->flags &= ~(BM_DIRTY | BM_JUST_DIRTIED);
bufHdr->cntxDirty = false;