1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-15 01:04:37 +02:00

Added an optional delay after manifest build so that files are not copied in the same second that the manifest is built. This can result in (admittedly unlikely) race conditions that can produce an invalid backup. I was also able to reduce the sleep types when waiting for thread termination - so unit test times are improved by almost 100%.

This commit is contained in:
David Steele
2015-01-02 14:18:07 -05:00
parent 297b22cb2b
commit 2e080eedb8
3 changed files with 27 additions and 5 deletions

View File

@ -1504,7 +1504,7 @@ sub BackRestTestBackup_Test
# Construct filename to test
my $strFile = BackRestTestCommon_DbCommonPathGet() . "/base";
# Get the oid of the user db
# Get the oid of the postgres db
my $strSql = "select oid from pg_database where datname = 'postgres'";
my $hStatement = $hDb->prepare($strSql);
@ -1523,7 +1523,7 @@ sub BackRestTestBackup_Test
$hStatement->execute() or
confess &log(ERROR, "Unable to execute: ${strSql}");
my @oyRow = $hStatement->fetchrow_array();
@oyRow = $hStatement->fetchrow_array();
$strFile .= '/' . $oyRow[0];
&log(INFO, 'table filename = ' . $strFile);
@ -1532,7 +1532,7 @@ sub BackRestTestBackup_Test
BackRestTestBackup_PgExecute("select pg_start_backup('test');");
# File modified in the same second that the manifest is taken and file is copied
# File modified in the same second after the manifest is taken and file is copied
while ($iRun < $iRunMax)
{
# Increment the run, log, and decide whether this unit test should be run