diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-03-18 05:24:13 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-03-18 05:24:13 +0000 |
commit | afb66ad8dd7fa731a82a587d48de764fa64b8fbf (patch) | |
tree | a0fb4445b7c0133b2afefe9e9fadb127ff9d3a8e | |
parent | 7a969cad2ed6559a7e17d7ce7920f5e59141d765 (diff) | |
download | postgresql-afb66ad8dd7fa731a82a587d48de764fa64b8fbf.tar.gz postgresql-afb66ad8dd7fa731a82a587d48de764fa64b8fbf.zip |
Need to release buffer pins before attempting to drop files during
backend exit. Per report from Bruce.
-rw-r--r-- | src/backend/utils/init/postinit.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index d1479bbab77..901053f1839 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.141 2005/02/26 18:43:33 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.142 2005/03/18 05:24:13 tgl Exp $ * * *------------------------------------------------------------------------- @@ -507,13 +507,14 @@ ShutdownPostgres(int code, Datum arg) * since that just raises the odds of failure --- but there's some * stuff we need to do. * - * Release any LW locks and buffer context locks we might be holding. - * This is a kluge to improve the odds that we won't get into a - * self-made stuck-lock scenario while trying to shut down. + * Release any LW locks, buffer content locks, and buffer pins we might be + * holding. This is a kluge to improve the odds that we won't get into a + * self-made stuck-lock scenario while trying to shut down. We *must* + * release buffer pins to make it safe to do file deletion, since we + * might have some pins on pages of the target files. */ LWLockReleaseAll(); - AbortBufferIO(); - UnlockBuffers(); + AtProcExit_Buffers(); /* * In case a transaction is open, delete any files it created. This |