1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-12-13 23:25:51 +02:00

Fix custom settings for compress-level option being ignored.

Reported by Jens Wilke.
This commit is contained in:
David Steele
2017-10-22 18:05:46 -04:00
parent 3553ccae44
commit d82fe88031
30 changed files with 594 additions and 352 deletions

View File

@@ -967,6 +967,15 @@ sub configCreate
$oParamHash{&CFGDEF_SECTION_GLOBAL}{cfgOptionName(CFGOPT_PROTOCOL_TIMEOUT)} = 60;
$oParamHash{&CFGDEF_SECTION_GLOBAL}{cfgOptionName(CFGOPT_DB_TIMEOUT)} = 45;
# Set to make sure that changinf the default works and to speed compression for testing
$oParamHash{&CFGDEF_SECTION_GLOBAL}{cfgOptionName(CFGOPT_COMPRESS_LEVEL)} = 3;
# Only set network compress level if there is more than one host
if ($oHostBackup != $oHostDbMaster)
{
$oParamHash{&CFGDEF_SECTION_GLOBAL}{cfgOptionName(CFGOPT_COMPRESS_LEVEL_NETWORK)} = 1;
}
if (defined($$oParam{bCompress}) && !$$oParam{bCompress})
{
$oParamHash{&CFGDEF_SECTION_GLOBAL}{cfgOptionName(CFGOPT_COMPRESS)} = 'n';

View File

@@ -106,8 +106,9 @@ sub run
#---------------------------------------------------------------------------------------------------------------------------
my $oGzipIo = $self->testResult(
sub {new pgBackRest::Storage::Filter::Gzip($oDriver->openWrite($strFileGz), {bWantGzip => false})},
sub {new pgBackRest::Storage::Filter::Gzip($oDriver->openWrite($strFileGz), {bWantGzip => false, iLevel => 3})},
'[object]', 'new write compress');
$self->testResult($oGzipIo->{iLevel}, 3, ' check level');
$self->testResult(sub {$oGzipIo->write(\$strFileContent, $iFileLength)}, $iFileLength, ' write');
$self->testResult(sub {$oGzipIo->close()}, true, ' close');