From a1f064fc2bd259dc8d75313df1cf9d5c294437f9 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 17 Oct 2012 12:37:15 -0400 Subject: Revert "Use "transient" files for blind writes, take 2". This reverts commit fba105b1099f4f5fa7283bb17cba6fed2baa8d0c. That approach had problems with the smgr-level state not tracking what we really want to happen, and with the VFD-level state not tracking the smgr-level state very well either. In consequence, it was still possible to hold kernel file descriptors open for long-gone tables (as in recent report from Tore Halset), and yet there were also cases of FDs being closed undesirably soon. A replacement implementation will follow. --- src/backend/storage/buffer/bufmgr.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/backend/storage/buffer/bufmgr.c') diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 77d4fbf0b9a..91ef1a35e3e 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -1882,10 +1882,7 @@ BufferGetTag(Buffer buffer, RelFileNode *rnode, ForkNumber *forknum, * written.) * * If the caller has an smgr reference for the buffer's relation, pass it - * as the second parameter. If not, pass NULL. In the latter case, the - * relation will be marked as "transient" so that the corresponding - * kernel-level file descriptors are closed when the current transaction ends, - * if any. + * as the second parameter. If not, pass NULL. */ static void FlushBuffer(volatile BufferDesc *buf, SMgrRelation reln) @@ -1909,12 +1906,9 @@ FlushBuffer(volatile BufferDesc *buf, SMgrRelation reln) errcontext.previous = error_context_stack; error_context_stack = &errcontext; - /* Find smgr relation for buffer, and mark it as transient */ + /* Find smgr relation for buffer */ if (reln == NULL) - { reln = smgropen(buf->tag.rnode, InvalidBackendId); - smgrsettransient(reln); - } TRACE_POSTGRESQL_BUFFER_FLUSH_START(buf->tag.forkNum, buf->tag.blockNum, -- cgit v1.2.3