1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-09-16 09:06:18 +02:00

Move log option update to after fork() in archive-push.

The log-level-console option should not be changed in the parent process. Even though it is harmless at the moment, that may not always be true.

Per review by Cynthia Shang.
This commit is contained in:
David Steele
2018-02-05 12:41:42 -05:00
parent c3f47bf240
commit 2074e6fbf9
3 changed files with 8 additions and 4 deletions

View File

@@ -33,6 +33,10 @@
<release-feature-list>
<release-item>
<release-item-contributor-list>
<release-item-reviewer id="shang.cynthia"/>
</release-item-contributor-list>
<p>The <cmd>archive-push</cmd> command is now partially coded in C which allows the <postgres/> <file>archive_command</file> to run significantly faster when processing status messages from the asynchronous archive process.</p>
</release-item>

View File

@@ -138,14 +138,14 @@ cmdArchivePush()
// If the WAL segment has not already been pushed then start the async process to push it
if (!pushed)
{
// Only want to see warnings and errors from async process
cfgOptionSet(cfgOptLogLevelConsole, cfgSourceParam, varNewStrZ("warn"));
// Async process is currently implemented in Perl
int processId = 0;
if ((processId = fork()) == 0)
{
// Only want to see warnings and errors from async process
cfgOptionSet(cfgOptLogLevelConsole, cfgSourceParam, varNewStrZ("warn"));
perlExec(perlCommand());
}
// Wait for async process to exit (this should happen quickly) and report any errors

View File

@@ -40,7 +40,7 @@ main(int argListSize, const char *argList[])
exit(0);
}
// Archive push command. Currently only implements to local operations of async archive push.
// Archive push command. Currently only implements local operations of async archive push.
// -------------------------------------------------------------------------------------------------------------------------
if (cfgCommand() == cfgCmdArchivePush && cfgOptionBool(cfgOptArchiveAsync))
{