diff options
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/storage/buffer/localbuf.c | 16 | ||||
-rw-r--r-- | src/backend/utils/init/postinit.c | 3 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c index d8737427029..16767b12df3 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.62 2005/01/10 20:02:21 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/storage/buffer/localbuf.c,v 1.62.4.1 2005/03/18 16:16:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -241,3 +241,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)); +} diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index 16d54ca0ba4..286e7d32f19 100644 --- a/src/backend/utils/init/postinit.c +++ b/src/backend/utils/init/postinit.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.139.4.1 2005/03/18 05:24:24 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.139.4.2 2005/03/18 16:16:20 tgl Exp $ * * *------------------------------------------------------------------------- @@ -478,6 +478,7 @@ ShutdownPostgres(int code, Datum arg) */ LWLockReleaseAll(); AtProcExit_Buffers(); + AtProcExit_LocalBuffers(); /* * In case a transaction is open, delete any files it created. This |