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

v0.61: bug fix for uncompressed remote destination

* Fixed a buffering error that could occur on large, highly-compressible files when copying to an uncompressed remote destination.  The error was detected in the decompression code and resulted in a failed backup rather than corruption so it should not affect successful backups made with previous versions.
This commit is contained in:
David Steele 2015-04-21 09:45:03 -04:00
parent 5185d49873
commit a9b9ec2492
5 changed files with 41 additions and 12 deletions

View File

@ -698,6 +698,10 @@ example: db-path=/data/db
## Release Notes ## Release Notes
### v0.61: bug fix for uncompressed remote destination
* Fixed a buffering error that could occur on large, highly-compressible files when copying to an uncompressed remote destination. The error was detected in the decompression code and resulted in a failed backup rather than corruption so it should not affect successful backups made with previous versions.
### v0.60: better version support and WAL improvements ### v0.60: better version support and WAL improvements
* Pushing duplicate WAL now generates an error. This worked before only if checksums were disabled. * Pushing duplicate WAL now generates an error. This worked before only if checksums were disabled.

View File

@ -1 +1 @@
0.60 0.61

View File

@ -656,6 +656,14 @@ Run a <id>full</id> backup on the <id>db</id> stanza. <param>--type</param> can
<release title="Release Notes"> <release title="Release Notes">
<release-version-list> <release-version-list>
<release-version version="0.61" title="bug fix for uncompressed remote destination">
<release-feature-bullet-list>
<release-feature>
<text>Fixed a buffering error that could occur on large, highly-compressible files when copying to an uncompressed remote destination. The error was detected in the decompression code and resulted in a failed backup rather than corruption so it should not affect successful backups made with previous versions.</text>
</release-feature>
</release-feature-bullet-list>
</release-version>
<release-version version="0.60" title="better version support and WAL improvements"> <release-version version="0.60" title="better version support and WAL improvements">
<release-feature-bullet-list> <release-feature-bullet-list>
<release-feature> <release-feature>

View File

@ -755,7 +755,7 @@ sub binary_xfer
last; last;
} }
} }
while ($iZLibStatus == Z_OK && $iUncompressedBufferSize > 0 && $iBlockSize > 0); while ($iZLibStatus != Z_STREAM_END && $iUncompressedBufferSize > 0 && $iBlockSize > 0);
} }
} }
while ($iBlockSize > 0); while ($iBlockSize > 0);
@ -1003,7 +1003,7 @@ sub binary_xfer
$iBlockSize = 0; $iBlockSize = 0;
} }
} }
while ($iZLibStatus == Z_OK && $iUncompressedBufferSize > 0 && $iBlockSize > 0); while ($iZLibStatus != Z_STREAM_END && $iUncompressedBufferSize > 0 && $iBlockSize > 0);
} }
} }
} }

View File

@ -1042,7 +1042,7 @@ sub BackRestTestFile_Test
$iRun = 0; $iRun = 0;
# Loop through small/large # Loop through small/large
for (my $bLarge = false; $bLarge <= 2; $bLarge++) for (my $iLarge = 0; $iLarge <= 3; $iLarge++)
{ {
# Loop through backup local vs remote # Loop through backup local vs remote
for (my $bBackupRemote = 0; $bBackupRemote <= 1; $bBackupRemote++) for (my $bBackupRemote = 0; $bBackupRemote <= 1; $bBackupRemote++)
@ -1075,13 +1075,13 @@ sub BackRestTestFile_Test
for (my $bDestinationPathType = 0; $bDestinationPathType <= 1; $bDestinationPathType++) for (my $bDestinationPathType = 0; $bDestinationPathType <= 1; $bDestinationPathType++)
{ {
# Loop through source missing/present # Loop through source missing/present
for (my $bSourceMissing = 0; $bSourceMissing <= !$bLarge; $bSourceMissing++) for (my $bSourceMissing = 0; $bSourceMissing <= !$iLarge; $bSourceMissing++)
{ {
# Loop through source ignore/require # Loop through source ignore/require
for (my $bSourceIgnoreMissing = 0; $bSourceIgnoreMissing <= !$bLarge; $bSourceIgnoreMissing++) for (my $bSourceIgnoreMissing = 0; $bSourceIgnoreMissing <= !$iLarge; $bSourceIgnoreMissing++)
{ {
# Loop through checksum append # Loop through checksum append
for (my $bChecksumAppend = 0; $bChecksumAppend <= !$bLarge; $bChecksumAppend++) for (my $bChecksumAppend = 0; $bChecksumAppend <= !$iLarge; $bChecksumAppend++)
{ {
# Loop through source compression # Loop through source compression
for (my $bSourceCompressed = 0; $bSourceCompressed <= !$bSourceMissing; $bSourceCompressed++) for (my $bSourceCompressed = 0; $bSourceCompressed <= !$bSourceMissing; $bSourceCompressed++)
@ -1096,7 +1096,7 @@ sub BackRestTestFile_Test
my $strDestinationPath = $bDestinationPathType ? 'db' : 'backup'; my $strDestinationPath = $bDestinationPathType ? 'db' : 'backup';
if (!BackRestTestCommon_Run(++$iRun, if (!BackRestTestCommon_Run(++$iRun,
"lrg ${bLarge}, rmt " . "lrg ${iLarge}, rmt " .
(defined($strRemote) && ($strRemote eq $strSourcePath || (defined($strRemote) && ($strRemote eq $strSourcePath ||
$strRemote eq $strDestinationPath) ? 1 : 0) . $strRemote eq $strDestinationPath) ? 1 : 0) .
', srcpth ' . (defined($strRemote) && $strRemote eq $strSourcePath ? 'rmt' : 'lcl') . ', srcpth ' . (defined($strRemote) && $strRemote eq $strSourcePath ? 'rmt' : 'lcl') .
@ -1124,12 +1124,24 @@ sub BackRestTestFile_Test
if (!$bSourceMissing) if (!$bSourceMissing)
{ {
if ($bLarge) if ($iLarge)
{ {
$strSourceFile .= '.bin'; $strSourceFile .= '.bin';
$strDestinationFile .= '.bin'; $strDestinationFile .= '.bin';
BackRestTestCommon_Execute('cp ' . BackRestTestCommon_DataPathGet() . "/test.archive${bLarge}.bin ${strSourceFile}"); if ($iLarge < 3)
{
BackRestTestCommon_Execute('cp ' . BackRestTestCommon_DataPathGet() .
"/test.archive${iLarge}.bin ${strSourceFile}");
}
else
{
for (my $iTableSizeIdx = 0; $iTableSizeIdx < 100; $iTableSizeIdx++)
{
BackRestTestCommon_Execute('cat ' . BackRestTestCommon_DataPathGet() .
"/test.table.bin >> ${strSourceFile}");
}
}
} }
else else
{ {
@ -1139,16 +1151,21 @@ sub BackRestTestFile_Test
system("echo 'TESTDATA' > ${strSourceFile}"); system("echo 'TESTDATA' > ${strSourceFile}");
} }
if ($bLarge == 1) if ($iLarge == 1)
{ {
$strSourceHash = 'c2e63b6a49d53a53d6df1aa6b70c7c16747ca099'; $strSourceHash = 'c2e63b6a49d53a53d6df1aa6b70c7c16747ca099';
$iSourceSize = 16777216; $iSourceSize = 16777216;
} }
elsif ($bLarge == 2) elsif ($iLarge == 2)
{ {
$strSourceHash = '1c7e00fd09b9dd11fc2966590b3e3274645dd031'; $strSourceHash = '1c7e00fd09b9dd11fc2966590b3e3274645dd031';
$iSourceSize = 16777216; $iSourceSize = 16777216;
} }
elsif ($iLarge == 3)
{
$strSourceHash = 'c23a89d47c7a006fcda51da0cc95993dc9aad995';
$iSourceSize = 104857600;
}
else else
{ {
$strSourceHash = '06364afe79d801433188262478a76d19777ef351'; $strSourceHash = '06364afe79d801433188262478a76d19777ef351';