mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-01-18 04:58:51 +02:00
Minor optimizations to package loads and ordering for archive-get and archive-push commands.
This commit is contained in:
parent
f3b62d2d67
commit
9e248a6627
@ -23,7 +23,6 @@ use pgBackRest::Common::Exit;
|
||||
use pgBackRest::Common::Lock;
|
||||
use pgBackRest::Common::Log;
|
||||
use pgBackRest::Config::Config;
|
||||
use pgBackRest::Storage::Local;
|
||||
use pgBackRest::Protocol::Helper;
|
||||
|
||||
####################################################################################################################################
|
||||
@ -54,6 +53,30 @@ local $EVAL_ERROR = undef; eval
|
||||
testSet(optionGet(OPTION_TEST), optionGet(OPTION_TEST_DELAY), optionGet(OPTION_TEST_POINT, false));
|
||||
}
|
||||
|
||||
################################################################################################################################
|
||||
# Process archive-push command
|
||||
################################################################################################################################
|
||||
if (commandTest(CMD_ARCHIVE_PUSH))
|
||||
{
|
||||
# Load module dynamically
|
||||
require pgBackRest::Archive::Push::Push;
|
||||
pgBackRest::Archive::Push::Push->import();
|
||||
|
||||
exitSafe(new pgBackRest::Archive::Push::Push()->process($ARGV[1]));
|
||||
}
|
||||
|
||||
################################################################################################################################
|
||||
# Process archive-get command
|
||||
################################################################################################################################
|
||||
if (commandTest(CMD_ARCHIVE_GET))
|
||||
{
|
||||
# Load module dynamically
|
||||
require pgBackRest::Archive::Get::Get;
|
||||
pgBackRest::Archive::Get::Get->import();
|
||||
|
||||
exitSafe(new pgBackRest::Archive::Get::Get()->process());
|
||||
}
|
||||
|
||||
################################################################################################################################
|
||||
# Process remote commands
|
||||
################################################################################################################################
|
||||
@ -107,38 +130,6 @@ local $EVAL_ERROR = undef; eval
|
||||
exitSafe($oLocal->process());
|
||||
}
|
||||
|
||||
################################################################################################################################
|
||||
# Archive commands must run on the db host
|
||||
################################################################################################################################
|
||||
if ((commandTest(CMD_ARCHIVE_PUSH) || commandTest(CMD_ARCHIVE_GET)) && !isDbLocal())
|
||||
{
|
||||
confess &log(ERROR, commandGet() . ' command must be run on the db host', ERROR_HOST_INVALID);
|
||||
}
|
||||
|
||||
################################################################################################################################
|
||||
# Process archive-push command
|
||||
################################################################################################################################
|
||||
if (commandTest(CMD_ARCHIVE_PUSH))
|
||||
{
|
||||
# Load module dynamically
|
||||
require pgBackRest::Archive::Push::Push;
|
||||
pgBackRest::Archive::Push::Push->import();
|
||||
|
||||
exitSafe(new pgBackRest::Archive::Push::Push()->process($ARGV[1]));
|
||||
}
|
||||
|
||||
################################################################################################################################
|
||||
# Process archive commands
|
||||
################################################################################################################################
|
||||
if (commandTest(CMD_ARCHIVE_GET))
|
||||
{
|
||||
# Load module dynamically
|
||||
require pgBackRest::Archive::Get::Get;
|
||||
pgBackRest::Archive::Get::Get->import();
|
||||
|
||||
exitSafe(new pgBackRest::Archive::Get::Get()->process());
|
||||
}
|
||||
|
||||
################################################################################################################################
|
||||
# Process check command
|
||||
################################################################################################################################
|
||||
|
@ -215,6 +215,10 @@
|
||||
<release-item>
|
||||
<p>Improve <proper>S3</proper> error reporting.</p>
|
||||
</release-item>
|
||||
|
||||
<release-item>
|
||||
<p>Minor optimizations to package loads and ordering for <cmd>archive-get</cmd> and <cmd>archive-push</cmd> commands.</p>
|
||||
</release-item>
|
||||
</release-refactor-list>
|
||||
</release-core-list>
|
||||
|
||||
|
@ -41,6 +41,12 @@ sub process
|
||||
# Assign function parameters, defaults, and log debug info
|
||||
my ($strOperation) = logDebugParam(__PACKAGE__ . '->process');
|
||||
|
||||
# Make sure the command happens on the db side
|
||||
if (!isDbLocal())
|
||||
{
|
||||
confess &log(ERROR, CMD_ARCHIVE_GET . ' operation must run on db host', ERROR_HOST_INVALID);
|
||||
}
|
||||
|
||||
# Make sure the archive file is defined
|
||||
if (!defined($ARGV[1]))
|
||||
{
|
||||
|
@ -53,7 +53,7 @@ sub process
|
||||
{name => 'strWalPathFile', required => false},
|
||||
);
|
||||
|
||||
# Make sure the archive push command happens on the db side
|
||||
# Make sure the command happens on the db side
|
||||
if (!isDbLocal())
|
||||
{
|
||||
confess &log(ERROR, CMD_ARCHIVE_PUSH . ' operation must run on db host', ERROR_HOST_INVALID);
|
||||
|
Loading…
Reference in New Issue
Block a user