You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-11-06 08:49:29 +02:00
Work on issue #48: Abandon threads and go to processes
More separation of the protocol and remote layers than was done in issue #106. Settings are passed to the remote via command-line parameters rather than in the protocol.
This commit is contained in:
@@ -28,6 +28,7 @@ use BackRest::File;
|
||||
use BackRest::Ini;
|
||||
use BackRest::Manifest;
|
||||
use BackRest::Protocol;
|
||||
use BackRest::Remote;
|
||||
use BackRest::Utility;
|
||||
|
||||
use BackRestTest::CommonTest;
|
||||
@@ -1511,25 +1512,21 @@ sub BackRestTestBackup_Test
|
||||
#-------------------------------------------------------------------------------------------------------------------------------
|
||||
# Create remotes
|
||||
#-------------------------------------------------------------------------------------------------------------------------------
|
||||
my $oRemote = BackRest::Protocol->new
|
||||
my $oRemote = new BackRest::Remote
|
||||
(
|
||||
$strHost, # Host
|
||||
$strUserBackRest, # User
|
||||
BackRestTestCommon_CommandRemoteGet(), # Command
|
||||
$strStanza, # Stanza
|
||||
'', # Repo Path
|
||||
OPTION_DEFAULT_BUFFER_SIZE, # Buffer size
|
||||
OPTION_DEFAULT_COMPRESS_LEVEL, # Compress level
|
||||
OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK, # Compress network level
|
||||
$strHost, # Host
|
||||
$strUserBackRest, # User
|
||||
BackRestTestCommon_CommandRemoteFullGet(), # Command
|
||||
OPTION_DEFAULT_BUFFER_SIZE, # Buffer size
|
||||
OPTION_DEFAULT_COMPRESS_LEVEL, # Compress level
|
||||
OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK, # Compress network level
|
||||
);
|
||||
|
||||
my $oLocal = new BackRest::Protocol
|
||||
(
|
||||
undef, # Host
|
||||
undef, # User
|
||||
undef, # Name
|
||||
false, # Is backend?
|
||||
undef, # Command
|
||||
undef, # Stanza
|
||||
undef, # Repo Path
|
||||
OPTION_DEFAULT_BUFFER_SIZE, # Buffer size
|
||||
OPTION_DEFAULT_COMPRESS_LEVEL, # Compress level
|
||||
OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK, # Compress network level
|
||||
|
||||
@@ -43,12 +43,13 @@ our @EXPORT = qw(BackRestTestCommon_Create BackRestTestCommon_Drop BackRestTestC
|
||||
BackRestTestCommon_DbPortGet BackRestTestCommon_iniLoad BackRestTestCommon_iniSave BackRestTestCommon_DbVersion
|
||||
BackRestTestCommon_CommandPsqlGet BackRestTestCommon_DropRepo BackRestTestCommon_CreateRepo
|
||||
BackRestTestCommon_manifestLoad BackRestTestCommon_manifestSave BackRestTestCommon_CommandMainAbsGet
|
||||
BackRestTestCommon_TestLogAppendFile);
|
||||
BackRestTestCommon_TestLogAppendFile BackRestTestCommon_CommandRemoteFullGet);
|
||||
|
||||
my $strPgSqlBin;
|
||||
my $strCommonStanza;
|
||||
my $strCommonCommandMain;
|
||||
my $strCommonCommandRemote;
|
||||
my $strCommonCommandRemoteFull;
|
||||
my $strCommonCommandPsql;
|
||||
my $strCommonHost;
|
||||
my $strCommonUser;
|
||||
@@ -776,6 +777,8 @@ sub BackRestTestCommon_Setup
|
||||
|
||||
$strCommonCommandMain = "../bin/pg_backrest";
|
||||
$strCommonCommandRemote = "${strCommonBasePath}/bin/pg_backrest";
|
||||
$strCommonCommandRemoteFull = "${strCommonCommandRemote} --stanza=${strCommonStanza}" .
|
||||
" --repo-remote-path=${strCommonRepoPath} --no-config remote";
|
||||
$strCommonCommandPsql = "${strPgSqlBin}/psql -X %option% -h ${strCommonDbPath}";
|
||||
|
||||
$iCommonDbPort = 6543;
|
||||
@@ -1198,6 +1201,11 @@ sub BackRestTestCommon_CommandRemoteGet
|
||||
return $strCommonCommandRemote;
|
||||
}
|
||||
|
||||
sub BackRestTestCommon_CommandRemoteFullGet
|
||||
{
|
||||
return $strCommonCommandRemoteFull;
|
||||
}
|
||||
|
||||
sub BackRestTestCommon_HostGet
|
||||
{
|
||||
return $strCommonHost;
|
||||
|
||||
@@ -520,7 +520,7 @@ sub BackRestTestConfig_Test
|
||||
|
||||
my $strCommand = operationWrite(OP_ARCHIVE_GET);
|
||||
my $strExpectedCommand = abs_path($0) . " --backup-host=db.mydomain.com \"--db-path=/db path/main\"" .
|
||||
" --repo-path=/repo --stanza=main " . OP_ARCHIVE_GET;
|
||||
" --repo-path=/repo --repo-remote-path=/repo --stanza=main " . OP_ARCHIVE_GET;
|
||||
|
||||
if ($strCommand ne $strExpectedCommand)
|
||||
{
|
||||
|
||||
@@ -92,25 +92,21 @@ sub BackRestTestFile_Test
|
||||
#-------------------------------------------------------------------------------------------------------------------------------
|
||||
# Create remotes
|
||||
#-------------------------------------------------------------------------------------------------------------------------------
|
||||
my $oRemote = BackRest::Protocol->new
|
||||
my $oRemote = new BackRest::Remote
|
||||
(
|
||||
$strHost, # Host
|
||||
$strUser, # User
|
||||
BackRestTestCommon_CommandRemoteGet(), # Command
|
||||
$strStanza, # Stanza
|
||||
'', # Repo Path
|
||||
OPTION_DEFAULT_BUFFER_SIZE, # Buffer size
|
||||
OPTION_DEFAULT_COMPRESS_LEVEL, # Compress level
|
||||
OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK, # Compress network level
|
||||
$strHost, # Host
|
||||
$strUser, # User
|
||||
BackRestTestCommon_CommandRemoteFullGet(), # Command
|
||||
OPTION_DEFAULT_BUFFER_SIZE, # Buffer size
|
||||
OPTION_DEFAULT_COMPRESS_LEVEL, # Compress level
|
||||
OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK, # Compress network level
|
||||
);
|
||||
|
||||
my $oLocal = new BackRest::Protocol
|
||||
(
|
||||
undef, # Host
|
||||
undef, # User
|
||||
undef, # Name
|
||||
false, # Is backend?
|
||||
undef, # Command
|
||||
undef, # Stanza
|
||||
undef, # Repo Path
|
||||
OPTION_DEFAULT_BUFFER_SIZE, # Buffer size
|
||||
OPTION_DEFAULT_COMPRESS_LEVEL, # Compress level
|
||||
OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK, # Compress network level
|
||||
|
||||
@@ -44,11 +44,9 @@ sub BackRestTestUtility_Test
|
||||
#-------------------------------------------------------------------------------------------------------------------------------
|
||||
my $oLocal = new BackRest::Protocol
|
||||
(
|
||||
undef, # Host
|
||||
undef, # User
|
||||
undef, # Name
|
||||
false, # Is backend?
|
||||
undef, # Command
|
||||
undef, # Stanza
|
||||
undef, # Repo Path
|
||||
OPTION_DEFAULT_BUFFER_SIZE, # Buffer size
|
||||
OPTION_DEFAULT_COMPRESS_LEVEL, # Compress level
|
||||
OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK, # Compress network level
|
||||
|
||||
Reference in New Issue
Block a user