Skip to content

Commit 3049fe7

Browse files
committed
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...
1 parent b02414b commit 3049fe7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/backend/postmaster/bgwriter.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/postmaster/bgwriter.c,v 1.32 2006/11/30 18:29:12 tgl Exp $
40+
* $PostgreSQL: pgsql/src/backend/postmaster/bgwriter.c,v 1.33 2006/12/01 19:55:28 tgl Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -304,6 +304,13 @@ BackgroundWriterMain(void)
304304
* fast as we can.
305305
*/
306306
pg_usleep(1000000L);
307+
308+
/*
309+
* Close all open files after any error. This is helpful on Windows,
310+
* where holding deleted files open causes various strange errors.
311+
* It's not clear we need it elsewhere, but shouldn't hurt.
312+
*/
313+
smgrcloseall();
307314
}
308315

309316
/* We can now handle ereport(ERROR) */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy