1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-03-03 14:52:21 +02:00

Moved bNoStartStop tablespace mapping to Manifest object.

This commit is contained in:
David Steele 2015-01-31 18:23:37 -05:00
parent d7b669d560
commit 018a2afaca
2 changed files with 30 additions and 24 deletions

View File

@ -1308,29 +1308,7 @@ sub backup
# Build the backup manifest
my %oTablespaceMap;
if ($bNoStartStop)
{
my %oTablespaceManifestHash;
$oFile->manifest(PATH_DB_ABSOLUTE, $strDbClusterPath . '/pg_tblspc', \%oTablespaceManifestHash);
foreach my $strName (sort(keys $oTablespaceManifestHash{name}))
{
if ($strName eq '.' or $strName eq '..')
{
next;
}
if ($oTablespaceManifestHash{name}{"${strName}"}{type} ne 'l')
{
confess &log(ERROR, "pg_tblspc/${strName} is not a link");
}
&log(DEBUG, "Found tablespace ${strName}");
$oTablespaceMap{oid}{"${strName}"}{name} = $strName;
}
}
else
if (!$bNoStartStop)
{
$oDb->tablespace_map_get(\%oTablespaceMap);
}

View File

@ -503,7 +503,9 @@ sub test
}
####################################################################################################################################
# BUILD - Build the backup manifest
# BUILD
#
# Build the manifest object.
####################################################################################################################################
sub build
{
@ -519,6 +521,32 @@ sub build
if (!defined($strLevel))
{
$strLevel = 'base';
# If bNoStartStop then build the tablespace map from pg_tblspc path
if ($bNoStartStop)
{
$oTablespaceMapRef = {};
my %oTablespaceManifestHash;
$oFile->manifest(PATH_DB_ABSOLUTE, $strDbClusterPath . '/pg_tblspc', \%oTablespaceManifestHash);
foreach my $strName (sort(keys $oTablespaceManifestHash{name}))
{
if ($strName eq '.' or $strName eq '..')
{
next;
}
if ($oTablespaceManifestHash{name}{"${strName}"}{type} ne 'l')
{
confess &log(ERROR, "pg_tblspc/${strName} is not a link");
}
&log(DEBUG, "Found tablespace ${strName}");
${$oTablespaceMapRef}{oid}{"${strName}"}{name} = $strName;
}
}
}
# Get the manifest for this level