aboutsummaryrefslogtreecommitdiff
path: root/src/backend/postmaster
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-04-28 17:45:02 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-04-28 17:45:02 -0400
commit9cb7db3f0c1f554cdcbbd97f78a119a19756e6ef (patch)
tree0e8c68a72d14e3218264284990de9c3bf768e36f /src/backend/postmaster
parentcfffe83ba82021a1819a656e7ec5c28fb3a99152 (diff)
downloadpostgresql-9cb7db3f0c1f554cdcbbd97f78a119a19756e6ef.tar.gz
postgresql-9cb7db3f0c1f554cdcbbd97f78a119a19756e6ef.zip
In AtEOXact_Files, complain if any files remain unclosed at commit.
This change makes this module act more like most of our other low-level resource management modules. It's a caller error if something is not explicitly closed by the end of a successful transaction, so issue a WARNING about it. This would not actually have caught the file leak bug fixed in commit 231bcd080, because that was in a transaction-abort path; but it still seems like a good, and pretty cheap, cross-check. Discussion: https://postgr.es/m/152056616579.4966.583293218357089052@wrigleys.postgresql.org
Diffstat (limited to 'src/backend/postmaster')
-rw-r--r--src/backend/postmaster/autovacuum.c2
-rw-r--r--src/backend/postmaster/bgwriter.c2
-rw-r--r--src/backend/postmaster/checkpointer.c2
-rw-r--r--src/backend/postmaster/walwriter.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3b90b16daec..02e6d8131e0 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -531,7 +531,7 @@ AutoVacLauncherMain(int argc, char *argv[])
}
AtEOXact_Buffers(false);
AtEOXact_SMgr();
- AtEOXact_Files();
+ AtEOXact_Files(false);
AtEOXact_HashTables(false);
/*
diff --git a/src/backend/postmaster/bgwriter.c b/src/backend/postmaster/bgwriter.c
index b7813d7a4fb..d5ce685e54f 100644
--- a/src/backend/postmaster/bgwriter.c
+++ b/src/backend/postmaster/bgwriter.c
@@ -198,7 +198,7 @@ BackgroundWriterMain(void)
/* we needn't bother with the other ResourceOwnerRelease phases */
AtEOXact_Buffers(false);
AtEOXact_SMgr();
- AtEOXact_Files();
+ AtEOXact_Files(false);
AtEOXact_HashTables(false);
/*
diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c
index 4b452e7cee6..0950ada6019 100644
--- a/src/backend/postmaster/checkpointer.c
+++ b/src/backend/postmaster/checkpointer.c
@@ -282,7 +282,7 @@ CheckpointerMain(void)
/* we needn't bother with the other ResourceOwnerRelease phases */
AtEOXact_Buffers(false);
AtEOXact_SMgr();
- AtEOXact_Files();
+ AtEOXact_Files(false);
AtEOXact_HashTables(false);
/* Warn any waiting backends that the checkpoint failed. */
diff --git a/src/backend/postmaster/walwriter.c b/src/backend/postmaster/walwriter.c
index 4fa3a3b0aaf..688d5b5b80b 100644
--- a/src/backend/postmaster/walwriter.c
+++ b/src/backend/postmaster/walwriter.c
@@ -179,7 +179,7 @@ WalWriterMain(void)
/* we needn't bother with the other ResourceOwnerRelease phases */
AtEOXact_Buffers(false);
AtEOXact_SMgr();
- AtEOXact_Files();
+ AtEOXact_Files(false);
AtEOXact_HashTables(false);
/*