You've already forked pgbackrest
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:
@@ -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>
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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))
|
||||
{
|
||||
|
Reference in New Issue
Block a user