aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-12-01 19:55:28 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-12-01 19:55:28 +0000
commit3049fe7cfa994208cb15cf0c9a20e773839ebf8f (patch)
tree7c3d96f542ee85dedf878bb60539a8aa6a489359
parentb02414bb8270a8c6a15a58734e7f1c76c65892e3 (diff)
downloadpostgresql-3049fe7cfa994208cb15cf0c9a20e773839ebf8f.tar.gz
postgresql-3049fe7cfa994208cb15cf0c9a20e773839ebf8f.zip
Make the bgwriter's error recovery path do smgrcloseall(). On Windows this
should allow delete-pending files to actually go away, and thereby work around the various complaints we've seen about 'permission denied' errors in such cases. Should be reasonably harmless in any case...
-rw-r--r--src/backend/postmaster/bgwriter.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/postmaster/bgwriter.c b/src/backend/postmaster/bgwriter.c
index 4d5c1d1cca8..9062b4f7deb 100644
--- a/src/backend/postmaster/bgwriter.c
+++ b/src/backend/postmaster/bgwriter.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/bgwriter.c,v 1.32 2006/11/30 18:29:12 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/bgwriter.c,v 1.33 2006/12/01 19:55:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -304,6 +304,13 @@ BackgroundWriterMain(void)
* fast as we can.
*/
pg_usleep(1000000L);
+
+ /*
+ * Close all open files after any error. This is helpful on Windows,
+ * where holding deleted files open causes various strange errors.
+ * It's not clear we need it elsewhere, but shouldn't hurt.
+ */
+ smgrcloseall();
}
/* We can now handle ereport(ERROR) */