File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed
Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 99 *
1010 *
1111 * IDENTIFICATION
12- * $PostgreSQL: pgsql/src/backend/storage/buffer/localbuf.c,v 1.63 2005/03/04 20:21:06 tgl Exp $
12+ * $PostgreSQL: pgsql/src/backend/storage/buffer/localbuf.c,v 1.64 2005/03/18 16:16:09 tgl Exp $
1313 *
1414 *-------------------------------------------------------------------------
1515 */
@@ -259,3 +259,17 @@ AtEOXact_LocalBuffers(bool isCommit)
259259 }
260260#endif
261261}
262+
263+ /*
264+ * AtProcExit_LocalBuffers - ensure we have dropped pins during backend exit.
265+ *
266+ * This is just like AtProcExit_Buffers, but for local buffers. We have
267+ * to drop pins to ensure that any attempt to drop temp files doesn't
268+ * fail in DropRelFileNodeBuffers.
269+ */
270+ void
271+ AtProcExit_LocalBuffers (void )
272+ {
273+ /* just zero the refcounts ... */
274+ MemSet (LocalRefCount , 0 , NLocBuffer * sizeof (* LocalRefCount ));
275+ }
Original file line number Diff line number Diff line change 88 *
99 *
1010 * IDENTIFICATION
11- * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.142 2005/03/18 05:24:13 tgl Exp $
11+ * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.143 2005/03/18 16:16:09 tgl Exp $
1212 *
1313 *
1414 *-------------------------------------------------------------------------
@@ -515,6 +515,7 @@ ShutdownPostgres(int code, Datum arg)
515515 */
516516 LWLockReleaseAll ();
517517 AtProcExit_Buffers ();
518+ AtProcExit_LocalBuffers ();
518519
519520 /*
520521 * In case a transaction is open, delete any files it created. This
Original file line number Diff line number Diff line change 77 * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
88 * Portions Copyright (c) 1994, Regents of the University of California
99 *
10- * $PostgreSQL: pgsql/src/include/storage/bufmgr.h,v 1.90 2005/03/04 20:21:07 tgl Exp $
10+ * $PostgreSQL: pgsql/src/include/storage/bufmgr.h,v 1.91 2005/03/18 16:16:09 tgl Exp $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -158,6 +158,7 @@ extern void BufferSync(void);
158158extern void BgBufferSync (void );
159159
160160extern void InitLocalBuffer (void );
161+ extern void AtProcExit_LocalBuffers (void );
161162
162163/* in freelist.c */
163164extern void StrategyHintVacuum (bool vacuum_active );
You can’t perform that action at this time.
0 commit comments