1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-01-30 05:39:12 +02:00

Fixed a race condition in parallel archiving.

Creation of new paths generated an error when multiple processes attempted to do so at the same time.

Reported by Jens Wilke.
This commit is contained in:
David Steele 2017-02-13 09:58:50 -05:00
parent bc2bb040c5
commit adcc7cb954
2 changed files with 10 additions and 7 deletions

View File

@ -158,6 +158,14 @@
<p>Fixed an issue where an archive-push error would not be retried and would instead return errors to <postgres/> indefinitely (unless the <file>.error</file> file was manually deleted).</p>
</release-item>
<release-item>
<release-item-contributor-list>
<release-item-ideator id="wilke.jens"/>
</release-item-contributor-list>
<p>Fixed a race condition in parallel archiving where creation of new paths generated an error when multiple processes attempted to do so at the same time.</p>
</release-item>
</release-bug-list>
</release-core-list>

View File

@ -268,16 +268,11 @@ sub fileList
{
my $strError = $!;
# If path exists then throw the error
if (fileExists($strPath))
# Ignore the error is the file is missing and missing files should be ignored
if (!($!{ENOENT} && $bIgnoreMissing))
{
confess &log(ERROR, "unable to read ${strPath}" . (defined($strError) ? ": $strError" : ''), ERROR_PATH_OPEN);
}
# Else throw an error unless missing paths are ignored
elsif (!$bIgnoreMissing)
{
confess &log(ERROR, "${strPath} does not exist", ERROR_PATH_MISSING);
}
}
# Return from function and log return values if any