2017-04-03 10:42:55 -04:00
|
|
|
####################################################################################################################################
|
2017-08-04 16:10:51 -04:00
|
|
|
# Mock Stanza Module Tests
|
2017-04-03 10:42:55 -04:00
|
|
|
####################################################################################################################################
|
2017-08-04 16:10:51 -04:00
|
|
|
package pgBackRestTest::Module::Mock::MockStanzaTest;
|
2017-05-12 16:43:04 -04:00
|
|
|
use parent 'pgBackRestTest::Env::HostEnvTest';
|
2017-04-03 10:42:55 -04:00
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# Perl includes
|
|
|
|
####################################################################################################################################
|
|
|
|
use strict;
|
|
|
|
use warnings FATAL => qw(all);
|
|
|
|
use Carp qw(confess);
|
|
|
|
|
|
|
|
use File::Basename qw(dirname);
|
|
|
|
|
2017-06-21 08:02:21 -04:00
|
|
|
use pgBackRest::Archive::Info;
|
2017-05-15 16:01:00 -04:00
|
|
|
use pgBackRest::Backup::Info;
|
2017-04-03 10:42:55 -04:00
|
|
|
use pgBackRest::Common::Exception;
|
|
|
|
use pgBackRest::Common::Ini;
|
|
|
|
use pgBackRest::Common::Log;
|
|
|
|
use pgBackRest::Common::Wait;
|
|
|
|
use pgBackRest::Config::Config;
|
2017-06-09 17:51:41 -04:00
|
|
|
use pgBackRest::DbVersion;
|
2017-04-03 10:42:55 -04:00
|
|
|
use pgBackRest::InfoCommon;
|
|
|
|
use pgBackRest::Manifest;
|
2017-06-09 17:51:41 -04:00
|
|
|
use pgBackRest::Protocol::Storage::Helper;
|
2017-08-04 16:10:51 -04:00
|
|
|
use pgBackRest::Storage::Base;
|
|
|
|
use pgBackRest::Storage::Filter::Gzip;
|
2017-06-09 17:51:41 -04:00
|
|
|
use pgBackRest::Storage::Helper;
|
2017-04-03 10:42:55 -04:00
|
|
|
|
2017-05-12 16:43:04 -04:00
|
|
|
use pgBackRestTest::Env::HostEnvTest;
|
2017-04-03 10:42:55 -04:00
|
|
|
use pgBackRestTest::Common::ExecuteTest;
|
2017-06-09 17:51:41 -04:00
|
|
|
use pgBackRestTest::Common::FileTest;
|
2017-04-03 10:42:55 -04:00
|
|
|
use pgBackRestTest::Common::RunTest;
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# run
|
|
|
|
####################################################################################################################################
|
|
|
|
sub run
|
|
|
|
{
|
|
|
|
my $self = shift;
|
|
|
|
|
2017-06-12 10:52:32 -04:00
|
|
|
foreach my $bS3 (false, true)
|
|
|
|
{
|
2017-08-04 16:10:51 -04:00
|
|
|
foreach my $bRemote ($bS3 ? (false) : (false, true))
|
2017-04-03 10:42:55 -04:00
|
|
|
{
|
|
|
|
# Increment the run, log, and decide whether this unit test should be run
|
2017-06-12 10:52:32 -04:00
|
|
|
if (!$self->begin("remote $bRemote, s3 $bS3")) {next}
|
2017-04-03 10:42:55 -04:00
|
|
|
|
|
|
|
# Create hosts, file object, and config
|
2017-06-12 10:52:32 -04:00
|
|
|
my ($oHostDbMaster, $oHostDbStandby, $oHostBackup, $oHostS3) = $self->setup(
|
|
|
|
true, $self->expect(), {bHostBackup => $bRemote, bS3 => $bS3});
|
2017-04-03 10:42:55 -04:00
|
|
|
|
2017-08-04 16:10:51 -04:00
|
|
|
# Create the stanza
|
|
|
|
$oHostBackup->stanzaCreate('fail on missing control file', {iExpectedExitStatus => ERROR_FILE_OPEN,
|
|
|
|
strOptionalParam => '--no-' . OPTION_ONLINE});
|
|
|
|
|
2017-04-03 10:42:55 -04:00
|
|
|
# Create the test path for pg_control
|
2017-08-04 16:10:51 -04:00
|
|
|
storageDb()->pathCreate(($oHostDbMaster->dbBasePath() . '/' . DB_PATH_GLOBAL), {bCreateParent => true});
|
2017-04-03 10:42:55 -04:00
|
|
|
|
|
|
|
# Copy pg_control for stanza-create
|
2017-06-09 17:51:41 -04:00
|
|
|
storageDb()->copy(
|
|
|
|
$self->dataPath() . '/backup.pg_control_' . WAL_VERSION_93 . '.bin',
|
|
|
|
$oHostDbMaster->dbBasePath() . '/' . DB_FILE_PGCONTROL);
|
2017-04-03 10:42:55 -04:00
|
|
|
|
2017-08-04 16:10:51 -04:00
|
|
|
# Fail stanza upgrade before stanza-create has been performed
|
2017-04-03 10:42:55 -04:00
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
|
|
|
$oHostBackup->stanzaUpgrade('fail on stanza not initialized since archive.info is missing',
|
|
|
|
{iExpectedExitStatus => ERROR_FILE_MISSING, strOptionalParam => '--no-' . OPTION_ONLINE});
|
|
|
|
|
|
|
|
$oHostBackup->stanzaCreate('successfully create the stanza', {strOptionalParam => '--no-' . OPTION_ONLINE});
|
|
|
|
|
2017-08-04 16:10:51 -04:00
|
|
|
# Rerun stanza-create and confirm success without the need to use force on empty directories
|
|
|
|
$oHostBackup->stanzaCreate('successful rerun of stanza-create', {strOptionalParam => '--no-' . OPTION_ONLINE});
|
|
|
|
|
2017-04-03 10:42:55 -04:00
|
|
|
# Perform a stanza upgrade which will indicate already up to date
|
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
|
|
|
$oHostBackup->stanzaUpgrade('already up to date', {strOptionalParam => '--no-' . OPTION_ONLINE});
|
|
|
|
|
2017-08-04 16:10:51 -04:00
|
|
|
# Create the xlog path
|
|
|
|
my $strXlogPath = $oHostDbMaster->dbBasePath() . '/pg_xlog';
|
|
|
|
storageDb()->pathCreate($strXlogPath, {bCreateParent => true});
|
|
|
|
|
|
|
|
# Stanza Create fails - missing archive.info from non-empty archive dir
|
2017-04-03 10:42:55 -04:00
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
2017-08-04 16:10:51 -04:00
|
|
|
# Generate WAL then push to get valid archive data in the archive directory
|
|
|
|
my ($strArchiveFile, $strSourceFile) = $self->archiveGenerate($strXlogPath, 1, 1, WAL_VERSION_93);
|
|
|
|
my $strCommand = $oHostDbMaster->backrestExe() . ' --config=' . $oHostDbMaster->backrestConfig() .
|
|
|
|
' --stanza=db archive-push';
|
|
|
|
$oHostDbMaster->executeSimple($strCommand . " ${strSourceFile}", {oLogTest => $self->expect()});
|
|
|
|
|
|
|
|
# With data existing in the archive dir, remove the info files and confirm failure
|
|
|
|
forceStorageRemove(storageRepo(), STORAGE_REPO_ARCHIVE . qw{/} . ARCHIVE_INFO_FILE);
|
|
|
|
forceStorageRemove(storageRepo(), STORAGE_REPO_ARCHIVE . qw{/} . ARCHIVE_INFO_FILE . INI_COPY_EXT);
|
2017-06-09 17:51:41 -04:00
|
|
|
|
2017-08-04 16:10:51 -04:00
|
|
|
$oHostBackup->stanzaCreate('fail on archive info file missing from non-empty dir',
|
2017-04-03 10:42:55 -04:00
|
|
|
{iExpectedExitStatus => ERROR_FILE_MISSING, strOptionalParam => '--no-' . OPTION_ONLINE});
|
|
|
|
|
2017-08-04 16:10:51 -04:00
|
|
|
# Stanza Create fails using force - failure to unzip compressed file
|
2017-04-03 10:42:55 -04:00
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
2017-08-04 16:10:51 -04:00
|
|
|
# S3 doesn't support filesystem-style permissions so skip these tests
|
|
|
|
if (!$bS3)
|
|
|
|
{
|
|
|
|
# Change the permissions of the archive file so it cannot be read
|
|
|
|
forceStorageMode(
|
|
|
|
storageRepo(), STORAGE_REPO_ARCHIVE . qw{/} . PG_VERSION_93 . '-1/' . substr($strArchiveFile, 0, 16) . '/*.' .
|
|
|
|
COMPRESS_EXT,
|
|
|
|
'220');
|
|
|
|
|
|
|
|
# Force creation of the info file but fail on gunzip
|
|
|
|
$oHostBackup->stanzaCreate('gunzip fail on forced stanza-create',
|
|
|
|
{iExpectedExitStatus => ERROR_FILE_OPEN, strOptionalParam => '--no-' . OPTION_ONLINE . ' --' . OPTION_FORCE});
|
|
|
|
|
|
|
|
# Change permissions back
|
|
|
|
forceStorageMode(
|
|
|
|
storageRepo(), STORAGE_REPO_ARCHIVE . qw{/} . PG_VERSION_93 . '-1/' . substr($strArchiveFile, 0, 16) . '/*.' .
|
|
|
|
COMPRESS_EXT,
|
|
|
|
'640');
|
|
|
|
}
|
|
|
|
|
|
|
|
# Stanza Create succeeds when using force - recreates archive.info from compressed archive file
|
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# Force creation of archive info from the gz file
|
|
|
|
$oHostBackup->stanzaCreate('force create archive.info from gz file',
|
|
|
|
{strOptionalParam => '--no-' . OPTION_ONLINE . ' --' . OPTION_FORCE});
|
|
|
|
|
|
|
|
# Rerun without the force to ensure the format is still valid - this will hash check the info files and indicate the
|
|
|
|
# stanza already exists
|
|
|
|
$oHostBackup->stanzaCreate('repeat create', {strOptionalParam => '--no-' . OPTION_ONLINE});
|
|
|
|
|
|
|
|
# Stanza Create fails when not using force - hash check failure
|
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# Munge and save the archive info file
|
|
|
|
$oHostBackup->infoMunge(
|
|
|
|
storageRepo()->pathGet(STORAGE_REPO_ARCHIVE . qw{/} . ARCHIVE_INFO_FILE),
|
|
|
|
{&INFO_BACKUP_SECTION_DB => {&INFO_BACKUP_KEY_DB_VERSION => '8.0'}});
|
|
|
|
|
|
|
|
$oHostBackup->stanzaCreate('hash check fails requiring force',
|
|
|
|
{iExpectedExitStatus => ERROR_FILE_INVALID, strOptionalParam => '--no-' . OPTION_ONLINE});
|
|
|
|
|
|
|
|
$oHostBackup->stanzaCreate('use force to overwrite the invalid file',
|
|
|
|
{strOptionalParam => '--no-' . OPTION_ONLINE . ' --' . OPTION_FORCE});
|
|
|
|
|
|
|
|
# Cleanup the global hash but don't save the file (permission issues may prevent it anyway)
|
|
|
|
$oHostBackup->infoRestore(storageRepo()->pathGet(STORAGE_REPO_ARCHIVE . qw{/} . ARCHIVE_INFO_FILE), false);
|
|
|
|
|
|
|
|
# Stanza Create fails when not using force - database mismatch with pg_control file
|
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# Change the database version by copying a new pg_control file
|
|
|
|
storageDb()->remove($oHostDbMaster->dbBasePath() . '/' . DB_FILE_PGCONTROL);
|
|
|
|
storageDb()->copy(
|
|
|
|
$self->dataPath() . '/backup.pg_control_' . WAL_VERSION_94 . '.bin',
|
|
|
|
$oHostDbMaster->dbBasePath() . '/' . DB_FILE_PGCONTROL);
|
|
|
|
|
|
|
|
$oHostBackup->stanzaCreate('fail on database mismatch without force option',
|
|
|
|
{iExpectedExitStatus => ERROR_FILE_INVALID, strOptionalParam => '--no-' . OPTION_ONLINE});
|
|
|
|
|
|
|
|
# Restore pg_control
|
|
|
|
storageDb()->remove($oHostDbMaster->dbBasePath() . '/' . DB_FILE_PGCONTROL);
|
|
|
|
storageDb()->copy(
|
|
|
|
$self->dataPath() . '/backup.pg_control_' . WAL_VERSION_93 . '.bin',
|
|
|
|
$oHostDbMaster->dbBasePath() . '/' . DB_FILE_PGCONTROL);
|
|
|
|
|
|
|
|
# Stanza Create succeeds when using force - recreates archive.info from uncompressed archive file
|
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# Unzip the archive file and recreate the archive.info file from it
|
|
|
|
my $strArchiveTest = PG_VERSION_93 . "-1/${strArchiveFile}-f5035e2c3b83a9c32660f959b23451e78f7438f7";
|
|
|
|
|
|
|
|
forceStorageMode(
|
|
|
|
storageRepo(), dirname(storageRepo()->pathGet(STORAGE_REPO_ARCHIVE . "/${strArchiveTest}.gz")), 'g+w',
|
|
|
|
{bRecursive => true});
|
|
|
|
|
|
|
|
storageRepo()->copy(
|
|
|
|
storageRepo()->openRead(
|
|
|
|
STORAGE_REPO_ARCHIVE . "/${strArchiveTest}.gz",
|
|
|
|
{rhyFilter => [{strClass => STORAGE_FILTER_GZIP, rxyParam => [{strCompressType => STORAGE_DECOMPRESS}]}]}),
|
|
|
|
STORAGE_REPO_ARCHIVE . "/${strArchiveTest}");
|
|
|
|
|
|
|
|
$oHostBackup->stanzaCreate('force create archive.info from uncompressed file',
|
|
|
|
{strOptionalParam => '--no-' . OPTION_ONLINE . ' --' . OPTION_FORCE});
|
|
|
|
|
|
|
|
# Stanza Create succeeds when using force - missing archive file
|
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# Remove the uncompressed WAL archive file and archive.info
|
|
|
|
forceStorageRemove(storageRepo(), STORAGE_REPO_ARCHIVE . "/${strArchiveTest}");
|
|
|
|
forceStorageRemove(storageRepo(), STORAGE_REPO_ARCHIVE . qw{/} . ARCHIVE_INFO_FILE);
|
|
|
|
forceStorageRemove(storageRepo(), STORAGE_REPO_ARCHIVE . qw{/} . ARCHIVE_INFO_FILE . INI_COPY_EXT);
|
|
|
|
|
|
|
|
$oHostBackup->stanzaCreate('force with missing WAL archive file',
|
|
|
|
{strOptionalParam => '--no-' . OPTION_ONLINE . ' --' . OPTION_FORCE});
|
|
|
|
|
|
|
|
# Stanza Create succeeds when using force - missing archive directory
|
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# Remove the WAL archive directory
|
|
|
|
forceStorageRemove(
|
|
|
|
storageRepo(),
|
|
|
|
STORAGE_REPO_ARCHIVE . qw{/} . PG_VERSION_93 . '-1/' . substr($strArchiveFile, 0, 16), {bRecurse => true});
|
|
|
|
forceStorageRemove(storageRepo(), STORAGE_REPO_ARCHIVE . qw{/} . ARCHIVE_INFO_FILE);
|
|
|
|
forceStorageRemove(storageRepo(), STORAGE_REPO_ARCHIVE . qw{/} . ARCHIVE_INFO_FILE . INI_COPY_EXT);
|
|
|
|
|
|
|
|
$oHostBackup->stanzaCreate('force with missing WAL archive directory',
|
2017-04-03 10:42:55 -04:00
|
|
|
{strOptionalParam => '--no-' . OPTION_ONLINE . ' --' . OPTION_FORCE});
|
|
|
|
|
|
|
|
# Fail on archive push due to mismatch of DB since stanza not upgraded
|
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
2017-08-04 16:10:51 -04:00
|
|
|
my $strArchiveTestFile = $self->dataPath() . '/backup.wal1_';
|
|
|
|
|
2017-04-03 10:42:55 -04:00
|
|
|
# Upgrade the DB by copying new pg_control
|
2017-06-09 17:51:41 -04:00
|
|
|
storageDb()->copy(
|
|
|
|
$self->dataPath() . '/backup.pg_control_' . WAL_VERSION_94 . '.bin',
|
|
|
|
$oHostDbMaster->dbBasePath() . '/' . DB_FILE_PGCONTROL);
|
|
|
|
forceStorageMode(storageDb(), $oHostDbMaster->dbBasePath() . '/' . DB_FILE_PGCONTROL, '600');
|
2017-04-03 10:42:55 -04:00
|
|
|
|
|
|
|
# Fail on attempt to push an archive
|
|
|
|
$oHostDbMaster->archivePush($strXlogPath, $strArchiveTestFile . WAL_VERSION_94 . '.bin', 1, ERROR_ARCHIVE_MISMATCH);
|
|
|
|
|
|
|
|
# Perform a successful stanza upgrade noting additional history lines in info files for new version of the database
|
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
2017-08-04 16:10:51 -04:00
|
|
|
$oHostBackup->stanzaUpgrade('successful upgrade creates additional history', {strOptionalParam => '--no-' .
|
|
|
|
OPTION_ONLINE});
|
2017-04-03 10:42:55 -04:00
|
|
|
|
|
|
|
# After stanza upgrade, make sure archives are pushed to the new db verion-id directory (9.4-2)
|
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# Push a WAL segment so have a valid file in the latest DB archive dir only
|
|
|
|
$oHostDbMaster->archivePush($strXlogPath, $strArchiveTestFile . WAL_VERSION_94 . '.bin', 1);
|
|
|
|
$self->testResult(
|
2017-06-09 17:51:41 -04:00
|
|
|
sub {storageRepo()->list(STORAGE_REPO_ARCHIVE . qw{/} . PG_VERSION_94 . '-2/0000000100000001')},
|
|
|
|
"000000010000000100000001-1e34fa1c833090d94b9bb14f2a8d3153dca6ea27." . COMPRESS_EXT,
|
2017-04-03 10:42:55 -04:00
|
|
|
'check that WAL is in the archive at -2');
|
|
|
|
|
|
|
|
# Create a DB history mismatch between the info files
|
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# Remove the archive info file and force reconstruction
|
2017-06-09 17:51:41 -04:00
|
|
|
forceStorageRemove(storageRepo(), STORAGE_REPO_ARCHIVE . qw{/} . ARCHIVE_INFO_FILE);
|
|
|
|
forceStorageRemove(storageRepo(), STORAGE_REPO_ARCHIVE . qw{/} . ARCHIVE_INFO_FILE . INI_COPY_EXT);
|
|
|
|
|
2017-04-03 10:42:55 -04:00
|
|
|
$oHostBackup->stanzaCreate('use force to recreate the stanza producing mismatched info history but same current db-id',
|
|
|
|
{strOptionalParam => '--no-' . OPTION_ONLINE . ' --' . OPTION_FORCE});
|
|
|
|
|
|
|
|
# Create a DB-ID mismatch between the info files
|
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
2017-06-09 17:51:41 -04:00
|
|
|
forceStorageRemove(storageRepo(), STORAGE_REPO_BACKUP . qw{/} . FILE_BACKUP_INFO);
|
|
|
|
forceStorageRemove(storageRepo(), STORAGE_REPO_BACKUP . qw{/} . FILE_BACKUP_INFO . INI_COPY_EXT);
|
|
|
|
|
2017-04-03 10:42:55 -04:00
|
|
|
$oHostBackup->stanzaCreate('use force to recreate the stanza producing mismatched db-id',
|
|
|
|
{strOptionalParam => '--no-' . OPTION_ONLINE . ' --' . OPTION_FORCE});
|
|
|
|
|
|
|
|
# Confirm successful backup at db-1 although archive at db-2
|
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# Create the tablespace directory and perform a backup
|
2017-06-09 17:51:41 -04:00
|
|
|
storageTest()->pathCreate($oHostDbMaster->dbBasePath() . '/' . DB_PATH_PGTBLSPC);
|
2017-04-03 10:42:55 -04:00
|
|
|
$oHostBackup->backup('full', 'create first full backup ', {strOptionalParam => '--retention-full=2 --no-' .
|
|
|
|
OPTION_ONLINE . ' --log-level-console=detail'}, false);
|
|
|
|
|
2017-08-04 16:10:51 -04:00
|
|
|
# Stanza Create fails when not using force - no backup.info but backup exists
|
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
|
|
|
forceStorageRemove(storageRepo(), STORAGE_REPO_BACKUP . qw{/} . FILE_BACKUP_INFO);
|
|
|
|
forceStorageRemove(storageRepo(), STORAGE_REPO_BACKUP . qw{/} . FILE_BACKUP_INFO . INI_COPY_EXT);
|
|
|
|
|
|
|
|
$oHostBackup->stanzaCreate('fail no force to recreate the stanza from backups',
|
|
|
|
{iExpectedExitStatus => ERROR_FILE_MISSING, strOptionalParam => '--no-' . OPTION_ONLINE});
|
|
|
|
|
|
|
|
# Stanza Create succeeds using force - reconstruct backup.info from backup
|
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
|
|
|
$oHostBackup->stanzaCreate('use force to recreate the stanza from backups',
|
|
|
|
{strOptionalParam => '--no-' . OPTION_ONLINE . ' --' . OPTION_FORCE});
|
|
|
|
|
2017-04-03 10:42:55 -04:00
|
|
|
# Test archive dir version XX.Y-Z ensuring sort order of db ids is reconstructed correctly from the directory db-id value
|
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# Create the 10.0-3 directory and copy a WAL file to it (something that has a different system id)
|
2017-06-09 17:51:41 -04:00
|
|
|
forceStorageMode(storageRepo(), STORAGE_REPO_ARCHIVE, '770');
|
|
|
|
storageRepo()->pathCreate(STORAGE_REPO_ARCHIVE . '/10.0-3/0000000100000001', {bCreateParent => true});
|
|
|
|
storageRepo()->copy(
|
|
|
|
storageDb()->openRead($self->dataPath() . '/backup.wal1_' . WAL_VERSION_92 . '.bin'),
|
|
|
|
STORAGE_REPO_ARCHIVE . '/10.0-3/0000000100000001/000000010000000100000001');
|
|
|
|
forceStorageOwner(storageRepo(), STORAGE_REPO_ARCHIVE . '/10.0-3', $oHostBackup->userGet(), {bRecurse => true});
|
2017-04-03 10:42:55 -04:00
|
|
|
|
|
|
|
# Copy pg_control for 9.5
|
2017-06-09 17:51:41 -04:00
|
|
|
storageDb()->copy(
|
|
|
|
$self->dataPath() . '/backup.pg_control_' . WAL_VERSION_95 . '.bin',
|
|
|
|
$oHostDbMaster->dbBasePath() . '/' . DB_FILE_PGCONTROL);
|
|
|
|
forceStorageMode(storageDb(), $oHostDbMaster->dbBasePath() . '/' . DB_FILE_PGCONTROL, '600');
|
2017-04-03 10:42:55 -04:00
|
|
|
|
|
|
|
$oHostBackup->stanzaUpgrade('successfully upgrade with XX.Y-Z', {strOptionalParam => '--no-' . OPTION_ONLINE});
|
|
|
|
|
2017-04-06 19:36:37 -04:00
|
|
|
# Push a WAL and create a backup in the new DB to confirm diff changed to full and info command displays the JSON correctly
|
2017-04-03 10:42:55 -04:00
|
|
|
#--------------------------------------------------------------------------------------------------------------------------
|
|
|
|
$oHostDbMaster->archivePush($strXlogPath, $strArchiveTestFile . WAL_VERSION_95 . '.bin', 1);
|
2017-04-06 19:36:37 -04:00
|
|
|
|
|
|
|
# Test backup is changed from type=DIFF to FULL (WARN message displayed)
|
|
|
|
my $oExecuteBackup = $oHostBackup->backupBegin('diff', 'diff changed to full backup',
|
|
|
|
{strOptionalParam => '--retention-full=2 --no-' . OPTION_ONLINE . ' --log-level-console=detail'});
|
|
|
|
$oHostBackup->backupEnd('full', $oExecuteBackup, undef, false);
|
|
|
|
|
|
|
|
# Confirm info command displays the JSON correctly
|
2017-04-03 10:42:55 -04:00
|
|
|
$oHostDbMaster->info('db upgraded - db-1 and db-2 listed', {strOutput => INFO_OUTPUT_JSON});
|
|
|
|
}
|
2017-06-12 10:52:32 -04:00
|
|
|
}
|
2017-04-03 10:42:55 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
1;
|