aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-01-31 11:40:29 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-01-31 11:40:29 +0200
commit6a8ffe812d194ba6f4f26791b6388a4837d17d6c (patch)
treea216d01a84bfcf26e56042c6eebaa958afed0bfe
parent0fda3921380798897b6faca5e4fdcdc22f950f12 (diff)
downloadpostgresql-6a8ffe812d194ba6f4f26791b6388a4837d17d6c.tar.gz
postgresql-6a8ffe812d194ba6f4f26791b6388a4837d17d6c.zip
Remove some obsolete smgrcloseall() calls.
Before the advent of PROCSIGNAL_BARRIER_SMGRRELEASE, we didn't have a comprehensive way to deal with Windows file handles that get in the way of unlinking directories. We had smgrcloseall() calls in a few places to try to mitigate. It's still a good idea for bgwriter and checkpointer to do that once per checkpoint so they don't accumulate unbounded SMgrRelation objects, but there is no longer any reason to close them at other random places such as the error path, and the explanation as given in the comments is now obsolete. Author: Thomas Munro Reviewed-by: Heikki Linnakangas, Robert Haas Discussion: https://www.postgresql.org/message-id/CA%2BhUKGJ8NTvqLHz6dqbQnt2c8XCki4r2QvXjBQcXpVwxTY_pvA@mail.gmail.com
-rw-r--r--src/backend/postmaster/bgwriter.c7
-rw-r--r--src/backend/postmaster/checkpointer.c7
-rw-r--r--src/backend/postmaster/walwriter.c7
3 files changed, 0 insertions, 21 deletions
diff --git a/src/backend/postmaster/bgwriter.c b/src/backend/postmaster/bgwriter.c
index d7d6cc0cd7b..6736a660062 100644
--- a/src/backend/postmaster/bgwriter.c
+++ b/src/backend/postmaster/bgwriter.c
@@ -197,13 +197,6 @@ BackgroundWriterMain(void)
*/
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();
-
/* Report wait end here, when there is no further possibility of wait */
pgstat_report_wait_end();
}
diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c
index 5e949fc885b..a7bf00b0606 100644
--- a/src/backend/postmaster/checkpointer.c
+++ b/src/backend/postmaster/checkpointer.c
@@ -301,13 +301,6 @@ CheckpointerMain(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) */
diff --git a/src/backend/postmaster/walwriter.c b/src/backend/postmaster/walwriter.c
index 75c9f8707b7..e079dc65c88 100644
--- a/src/backend/postmaster/walwriter.c
+++ b/src/backend/postmaster/walwriter.c
@@ -186,13 +186,6 @@ WalWriterMain(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) */