Skip to content

Commit 741b1b2

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 19954a4 commit 741b1b2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,12 @@ PostmasterMain(int argc, char *argv[])
10641064
progname, external_pid_file, strerror(errno));
10651065
}
10661066

1067+
/*
1068+
* Remove old temporary files. At this point there can be no other
1069+
* Postgres processes running in this directory, so this should be safe.
1070+
*/
1071+
RemovePgTempFiles();
1072+
10671073
/*
10681074
* If enabled, start up syslogger collection subprocess
10691075
*/
@@ -1103,12 +1109,6 @@ PostmasterMain(int argc, char *argv[])
11031109
}
11041110
load_ident();
11051111

1106-
/*
1107-
* Remove old temporary files. At this point there can be no other
1108-
* Postgres processes running in this directory, so this should be safe.
1109-
*/
1110-
RemovePgTempFiles();
1111-
11121112
#ifdef HAVE_PTHREAD_IS_THREADED_NP
11131113

11141114
/*
@@ -4937,7 +4937,7 @@ read_backend_variables(char *id, Port *port)
49374937
fp = AllocateFile(id, PG_BINARY_R);
49384938
if (!fp)
49394939
{
4940-
write_stderr("could not read from backend variables file \"%s\": %s\n",
4940+
write_stderr("could not open backend variables file \"%s\": %s\n",
49414941
id, strerror(errno));
49424942
exit(1);
49434943
}

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