1
0
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:
David Steele
2015-06-18 15:39:30 -04:00
parent 22e126eda7
commit 4e2c14623b
27 changed files with 678 additions and 471 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -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)
{

View File

@@ -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

View File

@@ -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