aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer/localbuf.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-03-18 16:16:09 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-03-18 16:16:09 +0000
commit88164799ce8eaf7f1e019967926200caa9ae856c (patch)
tree4d986b4bfb4f3c266fdd4d2ee6ae02abb6343cf8 /src/backend/storage/buffer/localbuf.c
parent1f418555cf959e9761d965696304ce3bf239a943 (diff)
downloadpostgresql-88164799ce8eaf7f1e019967926200caa9ae856c.tar.gz
postgresql-88164799ce8eaf7f1e019967926200caa9ae856c.zip
Need to reset local buffer pin counts, not only shared buffer pins,
before we attempt any file deletions in ShutdownPostgres. Per Tatsuo.
Diffstat (limited to 'src/backend/storage/buffer/localbuf.c')
-rw-r--r--src/backend/storage/buffer/localbuf.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c
index f52ed71cd8b..eb6db2447a8 100644
--- a/src/backend/storage/buffer/localbuf.c
+++ b/src/backend/storage/buffer/localbuf.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/buffer/localbuf.c,v 1.63 2005/03/04 20:21:06 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/buffer/localbuf.c,v 1.64 2005/03/18 16:16:09 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -259,3 +259,17 @@ AtEOXact_LocalBuffers(bool isCommit)
}
#endif
}
+
+/*
+ * AtProcExit_LocalBuffers - ensure we have dropped pins during backend exit.
+ *
+ * This is just like AtProcExit_Buffers, but for local buffers. We have
+ * to drop pins to ensure that any attempt to drop temp files doesn't
+ * fail in DropRelFileNodeBuffers.
+ */
+void
+AtProcExit_LocalBuffers(void)
+{
+ /* just zero the refcounts ... */
+ MemSet(LocalRefCount, 0, NLocBuffer * sizeof(*LocalRefCount));
+}