Skip to content

Commit cc7a3a4

Browse files
committed
Make logging_collector=on work with non-windows EXEC_BACKEND again.
Commit b94ce6e reordered postmaster's startup sequence so that the tempfile directory is only cleaned up after all the necessary state for pg_ctl is collected. Unfortunately the chosen location is after the syslogger has been started; which normally is fine, except for !WIN32 EXEC_BACKEND builds, which pass information to children via files in the temp directory. Move the call to RemovePgTempFiles() to just before the syslogger has started. That's the first child we fork. Luckily EXEC_BACKEND is pretty much only used by endusers on windows, which has a separate method to pass information to children. That means the real world impact of this bug is very small. Discussion: 20150113182344.GF12272@alap3.anarazel.de Backpatch to 9.1, just as the previous commit was.
1 parent 71942a8 commit cc7a3a4

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,12 @@ PostmasterMain(int argc, char *argv[])
11731173
on_proc_exit(unlink_external_pid_file, 0);
11741174
}
11751175

1176+
/*
1177+
* Remove old temporary files. At this point there can be no other
1178+
* Postgres processes running in this directory, so this should be safe.
1179+
*/
1180+
RemovePgTempFiles();
1181+
11761182
/*
11771183
* If enabled, start up syslogger collection subprocess
11781184
*/
@@ -1230,13 +1236,6 @@ PostmasterMain(int argc, char *argv[])
12301236
*/
12311237
}
12321238

1233-
1234-
/*
1235-
* Remove old temporary files. At this point there can be no other
1236-
* Postgres processes running in this directory, so this should be safe.
1237-
*/
1238-
RemovePgTempFiles();
1239-
12401239
#ifdef HAVE_PTHREAD_IS_THREADED_NP
12411240

12421241
/*
@@ -6067,7 +6066,7 @@ read_backend_variables(char *id, Port *port)
60676066
fp = AllocateFile(id, PG_BINARY_R);
60686067
if (!fp)
60696068
{
6070-
write_stderr("could not read from backend variables file \"%s\": %s\n",
6069+
write_stderr("could not open backend variables file \"%s\": %s\n",
60716070
id, strerror(errno));
60726071
exit(1);
60736072
}

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