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

Archive async now works local, but there is a pending bug to make sure archive::path != backup::path.

Added code to be sure that restore will not try to log into the backup path unless it is local.
This commit is contained in:
David Steele 2015-01-28 00:28:21 -05:00
parent b98b2df9f8
commit 60550cd45b
3 changed files with 12 additions and 9 deletions

View File

@ -199,7 +199,7 @@ if (operation_get() eq OP_ARCHIVE_PUSH)
if ($bArchiveLocal)
{
$strStopFile = "${strArchivePath}/lock/" + param_get(PARAM_STANZA) + "-archive.stop";
$strStopFile = "${strArchivePath}/lock/" . param_get(PARAM_STANZA) . "-archive.stop";
}
# If an archive file is defined, then push it
@ -242,8 +242,8 @@ if (operation_get() eq OP_ARCHIVE_PUSH)
archive_push(config_key_load(CONFIG_SECTION_STANZA, CONFIG_KEY_PATH), $ARGV[1]);
# Exit if we are archiving local but no backup host has been defined
if (!($bArchiveLocal && defined(config_key_load(CONFIG_SECTION_BACKUP, CONFIG_KEY_HOST))))
# Exit if we are archiving async
if (!$bArchiveLocal)
{
remote_exit(0);
}
@ -264,10 +264,10 @@ if (operation_get() eq OP_ARCHIVE_PUSH)
}
# If no backup host is defined it makes no sense to run archive-push without a specified archive file so throw an error
if (!defined(config_key_load(CONFIG_SECTION_BACKUP, CONFIG_KEY_HOST)))
{
&log(ERROR, 'archive-push called without an archive file or backup host');
}
# if (!defined(config_key_load(CONFIG_SECTION_BACKUP, CONFIG_KEY_HOST)))
# {
# &log(ERROR, 'archive-push called without an archive file or backup host');
# }
&log(INFO, 'starting async archive-push');

View File

@ -254,7 +254,10 @@ sub config_load
# If this is a restore, then try to default config
if (!defined(config_key_load(CONFIG_SECTION_RESTORE, CONFIG_KEY_PATH)))
{
$oConfig{'global:restore'}{path} = config_key_load(CONFIG_SECTION_BACKUP, CONFIG_KEY_PATH);
if (!defined(config_key_load(CONFIG_SECTION_BACKUP, CONFIG_KEY_HOST)))
{
$oConfig{'global:restore'}{path} = config_key_load(CONFIG_SECTION_BACKUP, CONFIG_KEY_PATH);
}
if (!defined(config_key_load(CONFIG_SECTION_RESTORE, CONFIG_KEY_PATH)))
{

View File

@ -1050,7 +1050,7 @@ sub BackRestTestBackup_Test
{
for (my $bChecksum = false; $bChecksum <= true; $bChecksum++)
{
for (my $bArchiveAsync = false; $bArchiveAsync <= $bRemote; $bArchiveAsync++)
for (my $bArchiveAsync = false; $bArchiveAsync <= true $bArchiveAsync++)
{
for (my $bCompressAsync = false; $bCompressAsync <= true; $bCompressAsync++)
{