1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00

Fixed restore::thread-max

This commit is contained in:
David Steele 2015-01-31 15:37:59 -05:00
parent 0c9da6a5ab
commit 267efbd71d
3 changed files with 36 additions and 4 deletions

View File

@ -447,11 +447,11 @@ if (operation_get() eq OP_RESTORE)
# Do the restore # Do the restore
new BackRest::Restore new BackRest::Restore
( (
config_key_load(CONFIG_SECTION_STANZA, CONFIG_KEY_PATH), config_key_load(CONFIG_SECTION_STANZA, CONFIG_KEY_PATH, true),
param_get(PARAM_SET), param_get(PARAM_SET),
config_section_load(CONFIG_SECTION_TABLESPACE_MAP), config_section_load(CONFIG_SECTION_TABLESPACE_MAP),
$oFile, $oFile,
undef, #param_get(PARAM_THREAD), config_key_load(CONFIG_SECTION_RESTORE, CONFIG_KEY_THREAD_MAX, true),
param_get(PARAM_DELTA), param_get(PARAM_DELTA),
param_get(PARAM_FORCE), param_get(PARAM_FORCE),
param_get(PARAM_TYPE), param_get(PARAM_TYPE),

View File

@ -345,6 +345,26 @@ sub config_key_load
return $strValue; return $strValue;
} }
####################################################################################################################################
# CONFIG_KEY_SET
####################################################################################################################################
sub config_key_set
{
my $strSection = shift;
my $strKey = shift;
my $strValue = shift;
# Make sure all parameters are defined
if (!defined($strSection) || !defined($strKey) || !defined($strValue))
{
confess &log(ASSERT, 'section, key and value must all be defined');
}
# Set the value
$strSection = param_get(PARAM_STANZA) . ':' . $strSection;
$oConfig{$strSection}{$strKey} = $strValue;
}
#################################################################################################################################### ####################################################################################################################################
# CONFIG_VALID # CONFIG_VALID
@ -357,7 +377,7 @@ sub config_valid
my $strSection; my $strSection;
my $oSectionHashRef; my $oSectionHashRef;
# Check recovery:option section # Check [stanza]:recovery:option section
$strSection = param_get(PARAM_STANZA) . ':' . CONFIG_SECTION_RECOVERY_OPTION; $strSection = param_get(PARAM_STANZA) . ':' . CONFIG_SECTION_RECOVERY_OPTION;
$oSectionHashRef = $oConfig{$strSection}; $oSectionHashRef = $oConfig{$strSection};
@ -379,6 +399,18 @@ sub config_valid
} }
} }
} }
# Default thread-max
if (!defined(config_key_load(CONFIG_SECTION_BACKUP, CONFIG_KEY_THREAD_MAX)))
{
config_key_set(CONFIG_SECTION_BACKUP, CONFIG_KEY_THREAD_MAX, 1);
}
if (!defined(config_key_load(CONFIG_SECTION_RESTORE, CONFIG_KEY_THREAD_MAX)))
{
config_key_set(CONFIG_SECTION_RESTORE, CONFIG_KEY_THREAD_MAX,
config_key_load(CONFIG_SECTION_BACKUP, CONFIG_KEY_THREAD_MAX, true));
}
} }
#################################################################################################################################### ####################################################################################################################################

View File

@ -1007,7 +1007,7 @@ sub BackRestTestBackup_Restore
($bDelta ? ' delta' : '') . ($bDelta ? ' delta' : '') .
($bForce ? ', force' : '') . ($bForce ? ', force' : '') .
($strBackup ne 'latest' ? ", backup '${strBackup}'" : '') . ($strBackup ne 'latest' ? ", backup '${strBackup}'" : '') .
($strType ? ", type '${strType}' " : '') . ($strType ? ", type '${strType}'" : '') .
($strTarget ? ", target '${strTarget}'" : '') . ($strTarget ? ", target '${strTarget}'" : '') .
($strTargetTimeline ? ", timeline '${strTargetTimeline}'" : '') . ($strTargetTimeline ? ", timeline '${strTargetTimeline}'" : '') .
(defined($bTargetExclusive) && $bTargetExclusive ? ', exclusive' : '') . (defined($bTargetExclusive) && $bTargetExclusive ? ', exclusive' : '') .