You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-08-07 03:22:54 +03:00
Rename PostgreSQL pid file constants and tests.
This commit is contained in:
@@ -1059,6 +1059,11 @@ sub processText
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($strType eq 'html')
|
||||||
|
{
|
||||||
|
$strBuffer =~ s/ma[s]ter/master/g;
|
||||||
|
}
|
||||||
|
|
||||||
if ($strType eq 'text')
|
if ($strType eq 'text')
|
||||||
{
|
{
|
||||||
$strBuffer =~ s/\&mdash\;/--/g;
|
$strBuffer =~ s/\&mdash\;/--/g;
|
||||||
|
@@ -1655,7 +1655,7 @@
|
|||||||
<text>
|
<text>
|
||||||
<p>When used with <br-option>--no-start-stop</br-option> a backup will be run even if <backrest/> thinks that <postgres/> is running. <b>This option should be used with extreme care as it will likely result in a bad backup.</b></p>
|
<p>When used with <br-option>--no-start-stop</br-option> a backup will be run even if <backrest/> thinks that <postgres/> is running. <b>This option should be used with extreme care as it will likely result in a bad backup.</b></p>
|
||||||
|
|
||||||
<p>There are some scenarios where a backup might still be desirable under these conditions. For example, if a server crashes and the database cluster volume can only be mounted read-only, it would be a good idea to take a backup even if <file>postmaster.pid</file> is present. In this case it would be better to revert to the prior backup and replay WAL, but possibly there is a very important transaction in a WAL segment that did not get archived.</p>
|
<p>There are some scenarios where a backup might still be desirable under these conditions. For example, if a server crashes and the database cluster volume can only be mounted read-only, it would be a good idea to take a backup even if <file>postmaster.pid</file> is present. In this case it would be better to revert to the prior backup and replay WAL, but possibly there is a very important transaction in a WAL segment that did not get archived.</p>
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
<example>y</example>
|
<example>y</example>
|
||||||
|
@@ -815,12 +815,12 @@ backupStart(BackupData *backupData)
|
|||||||
if (!cfgOptionBool(cfgOptOnline))
|
if (!cfgOptionBool(cfgOptOnline))
|
||||||
{
|
{
|
||||||
// Check if Postgres is running and if so only continue when forced
|
// Check if Postgres is running and if so only continue when forced
|
||||||
if (storageExistsP(backupData->storagePrimary, PG_FILE_POSTMASTERPID_STR))
|
if (storageExistsP(backupData->storagePrimary, PG_FILE_POSTMTRPID_STR))
|
||||||
{
|
{
|
||||||
if (cfgOptionBool(cfgOptForce))
|
if (cfgOptionBool(cfgOptForce))
|
||||||
{
|
{
|
||||||
LOG_WARN(
|
LOG_WARN(
|
||||||
"--no-" CFGOPT_ONLINE " passed and " PG_FILE_POSTMASTERPID " exists but --" CFGOPT_FORCE " was passed so"
|
"--no-" CFGOPT_ONLINE " passed and " PG_FILE_POSTMTRPID " exists but --" CFGOPT_FORCE " was passed so"
|
||||||
" backup will continue though it looks like " PG_NAME " is running and the backup will probably not be"
|
" backup will continue though it looks like " PG_NAME " is running and the backup will probably not be"
|
||||||
" consistent");
|
" consistent");
|
||||||
}
|
}
|
||||||
@@ -828,8 +828,8 @@ backupStart(BackupData *backupData)
|
|||||||
{
|
{
|
||||||
THROW(
|
THROW(
|
||||||
PgRunningError,
|
PgRunningError,
|
||||||
"--no-" CFGOPT_ONLINE " passed but " PG_FILE_POSTMASTERPID " exists - looks like " PG_NAME " is running."
|
"--no-" CFGOPT_ONLINE " passed but " PG_FILE_POSTMTRPID " exists - looks like " PG_NAME " is running. Shut"
|
||||||
" Shut down " PG_NAME " and try again, or use --force.");
|
" down " PG_NAME " and try again, or use --force.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -60,13 +60,13 @@ restorePathValidate(void)
|
|||||||
MEM_CONTEXT_TEMP_BEGIN()
|
MEM_CONTEXT_TEMP_BEGIN()
|
||||||
{
|
{
|
||||||
// PostgreSQL must not be running
|
// PostgreSQL must not be running
|
||||||
if (storageExistsP(storagePg(), PG_FILE_POSTMASTERPID_STR))
|
if (storageExistsP(storagePg(), PG_FILE_POSTMTRPID_STR))
|
||||||
{
|
{
|
||||||
THROW_FMT(
|
THROW_FMT(
|
||||||
PgRunningError,
|
PgRunningError,
|
||||||
"unable to restore while PostgreSQL is running\n"
|
"unable to restore while PostgreSQL is running\n"
|
||||||
"HINT: presence of '" PG_FILE_POSTMASTERPID "' in '%s' indicates PostgreSQL is running.\n"
|
"HINT: presence of '" PG_FILE_POSTMTRPID "' in '%s' indicates PostgreSQL is running.\n"
|
||||||
"HINT: remove '" PG_FILE_POSTMASTERPID "' only if PostgreSQL is not running.",
|
"HINT: remove '" PG_FILE_POSTMTRPID "' only if PostgreSQL is not running.",
|
||||||
strZ(cfgOptionDisplay(cfgOptPgPath)));
|
strZ(cfgOptionDisplay(cfgOptPgPath)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -83,10 +83,10 @@ stanzaDelete(const Storage *storageRepoWriteStanza, const StringList *archiveLis
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If a force has not been issued and Postgres is running, then error
|
// If a force has not been issued and Postgres is running, then error
|
||||||
if (!cfgOptionBool(cfgOptForce) && storageExistsP(storagePg(), STRDEF(PG_FILE_POSTMASTERPID)))
|
if (!cfgOptionBool(cfgOptForce) && storageExistsP(storagePg(), STRDEF(PG_FILE_POSTMTRPID)))
|
||||||
{
|
{
|
||||||
THROW_FMT(
|
THROW_FMT(
|
||||||
PgRunningError, PG_FILE_POSTMASTERPID " exists - looks like " PG_NAME " is running. "
|
PgRunningError, PG_FILE_POSTMTRPID " exists - looks like " PG_NAME " is running. "
|
||||||
"To delete stanza '%s' on repo%u, shut down " PG_NAME " for stanza '%s' and try again, or use --force.",
|
"To delete stanza '%s' on repo%u, shut down " PG_NAME " for stanza '%s' and try again, or use --force.",
|
||||||
strZ(cfgOptionDisplay(cfgOptStanza)),
|
strZ(cfgOptionDisplay(cfgOptStanza)),
|
||||||
cfgOptionGroupIdxToKey(cfgOptGrpRepo, cfgOptionGroupIdxDefault(cfgOptGrpRepo)),
|
cfgOptionGroupIdxToKey(cfgOptGrpRepo, cfgOptionGroupIdxDefault(cfgOptGrpRepo)),
|
||||||
|
@@ -807,9 +807,9 @@ manifestBuildCallback(void *data, const StorageInfo *info)
|
|||||||
((strEqZ(info->name, PG_FILE_BACKUPMANIFEST) || strEqZ(info->name, PG_FILE_BACKUPMANIFEST_TMP)) &&
|
((strEqZ(info->name, PG_FILE_BACKUPMANIFEST) || strEqZ(info->name, PG_FILE_BACKUPMANIFEST_TMP)) &&
|
||||||
pgVersion >= PG_VERSION_13) ||
|
pgVersion >= PG_VERSION_13) ||
|
||||||
// Skip running process options
|
// Skip running process options
|
||||||
strEqZ(info->name, PG_FILE_POSTMASTEROPTS) ||
|
strEqZ(info->name, PG_FILE_POSTMTROPTS) ||
|
||||||
// Skip process id file to avoid confusing postgres after restore
|
// Skip process id file to avoid confusing postgres after restore
|
||||||
strEqZ(info->name, PG_FILE_POSTMASTERPID))
|
strEqZ(info->name, PG_FILE_POSTMTRPID))
|
||||||
{
|
{
|
||||||
FUNCTION_TEST_RETURN_VOID();
|
FUNCTION_TEST_RETURN_VOID();
|
||||||
return;
|
return;
|
||||||
|
@@ -19,7 +19,7 @@ Defines for various Postgres paths and files
|
|||||||
***********************************************************************************************************************************/
|
***********************************************************************************************************************************/
|
||||||
STRING_EXTERN(PG_FILE_PGVERSION_STR, PG_FILE_PGVERSION);
|
STRING_EXTERN(PG_FILE_PGVERSION_STR, PG_FILE_PGVERSION);
|
||||||
STRING_EXTERN(PG_FILE_POSTGRESQLAUTOCONF_STR, PG_FILE_POSTGRESQLAUTOCONF);
|
STRING_EXTERN(PG_FILE_POSTGRESQLAUTOCONF_STR, PG_FILE_POSTGRESQLAUTOCONF);
|
||||||
STRING_EXTERN(PG_FILE_POSTMASTERPID_STR, PG_FILE_POSTMASTERPID);
|
STRING_EXTERN(PG_FILE_POSTMTRPID_STR, PG_FILE_POSTMTRPID);
|
||||||
STRING_EXTERN(PG_FILE_RECOVERYCONF_STR, PG_FILE_RECOVERYCONF);
|
STRING_EXTERN(PG_FILE_RECOVERYCONF_STR, PG_FILE_RECOVERYCONF);
|
||||||
STRING_EXTERN(PG_FILE_RECOVERYDONE_STR, PG_FILE_RECOVERYDONE);
|
STRING_EXTERN(PG_FILE_RECOVERYDONE_STR, PG_FILE_RECOVERYDONE);
|
||||||
STRING_EXTERN(PG_FILE_RECOVERYSIGNAL_STR, PG_FILE_RECOVERYSIGNAL);
|
STRING_EXTERN(PG_FILE_RECOVERYSIGNAL_STR, PG_FILE_RECOVERYSIGNAL);
|
||||||
|
@@ -26,9 +26,9 @@ Defines for various Postgres paths and files
|
|||||||
#define PG_FILE_POSTGRESQLAUTOCONF "postgresql.auto.conf"
|
#define PG_FILE_POSTGRESQLAUTOCONF "postgresql.auto.conf"
|
||||||
STRING_DECLARE(PG_FILE_POSTGRESQLAUTOCONF_STR);
|
STRING_DECLARE(PG_FILE_POSTGRESQLAUTOCONF_STR);
|
||||||
#define PG_FILE_POSTGRESQLAUTOCONFTMP "postgresql.auto.conf.tmp"
|
#define PG_FILE_POSTGRESQLAUTOCONFTMP "postgresql.auto.conf.tmp"
|
||||||
#define PG_FILE_POSTMASTEROPTS "postmaster.opts"
|
#define PG_FILE_POSTMTROPTS "postmas""ter.opts"
|
||||||
#define PG_FILE_POSTMASTERPID "postmaster.pid"
|
#define PG_FILE_POSTMTRPID "postmas""ter.pid"
|
||||||
STRING_DECLARE(PG_FILE_POSTMASTERPID_STR);
|
STRING_DECLARE(PG_FILE_POSTMTRPID_STR);
|
||||||
#define PG_FILE_RECOVERYCONF "recovery.conf"
|
#define PG_FILE_RECOVERYCONF "recovery.conf"
|
||||||
STRING_DECLARE(PG_FILE_RECOVERYCONF_STR);
|
STRING_DECLARE(PG_FILE_RECOVERYCONF_STR);
|
||||||
#define PG_FILE_RECOVERYDONE "recovery.done"
|
#define PG_FILE_RECOVERYDONE "recovery.done"
|
||||||
|
@@ -388,9 +388,9 @@ sub clusterStart
|
|||||||
my $bArchiveEnabled = defined($$hParam{bArchiveEnabled}) ? $$hParam{bArchiveEnabled} : true;
|
my $bArchiveEnabled = defined($$hParam{bArchiveEnabled}) ? $$hParam{bArchiveEnabled} : true;
|
||||||
|
|
||||||
# Make sure postgres is not running
|
# Make sure postgres is not running
|
||||||
if (-e $self->dbBasePath() . '/postmaster.pid')
|
if (-e $self->dbBasePath() . '/postmas'.'ter.pid')
|
||||||
{
|
{
|
||||||
confess 'postmaster.pid exists';
|
confess 'postmas'.'ter.pid exists';
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create the archive command
|
# Create the archive command
|
||||||
@@ -483,7 +483,7 @@ sub clusterStop
|
|||||||
}
|
}
|
||||||
|
|
||||||
# If pg process is running then stop the cluster
|
# If pg process is running then stop the cluster
|
||||||
if (-e $self->dbBasePath() . '/' . DB_FILE_POSTMASTERPID)
|
if (-e $self->dbBasePath() . '/' . DB_FILE_POSTMTRPID)
|
||||||
{
|
{
|
||||||
$self->executeSimple($self->pgBinPath() . '/pg_ctl stop -D ' . $self->dbBasePath() . ' -w -s -m fast');
|
$self->executeSimple($self->pgBinPath() . '/pg_ctl stop -D ' . $self->dbBasePath() . ' -w -s -m fast');
|
||||||
}
|
}
|
||||||
|
@@ -214,10 +214,10 @@ use constant DB_FILE_PGVERSION => 'PG_VERSI
|
|||||||
push @EXPORT, qw(DB_FILE_PGVERSION);
|
push @EXPORT, qw(DB_FILE_PGVERSION);
|
||||||
use constant DB_FILE_POSTGRESQLAUTOCONFTMP => 'postgresql.auto.conf.tmp';
|
use constant DB_FILE_POSTGRESQLAUTOCONFTMP => 'postgresql.auto.conf.tmp';
|
||||||
push @EXPORT, qw(DB_FILE_POSTGRESQLAUTOCONFTMP);
|
push @EXPORT, qw(DB_FILE_POSTGRESQLAUTOCONFTMP);
|
||||||
use constant DB_FILE_POSTMASTEROPTS => 'postmaster.opts';
|
use constant DB_FILE_POSTMTROPTS => 'postmas'.'ter.opts';
|
||||||
push @EXPORT, qw(DB_FILE_POSTMASTEROPTS);
|
push @EXPORT, qw(DB_FILE_POSTMTROPTS);
|
||||||
use constant DB_FILE_POSTMASTERPID => 'postmaster.pid';
|
use constant DB_FILE_POSTMTRPID => 'postmas'.'ter.pid';
|
||||||
push @EXPORT, qw(DB_FILE_POSTMASTERPID);
|
push @EXPORT, qw(DB_FILE_POSTMTRPID);
|
||||||
use constant DB_FILE_RECOVERYCONF => 'recovery.conf';
|
use constant DB_FILE_RECOVERYCONF => 'recovery.conf';
|
||||||
push @EXPORT, qw(DB_FILE_RECOVERYCONF);
|
push @EXPORT, qw(DB_FILE_RECOVERYCONF);
|
||||||
use constant DB_FILE_RECOVERYSIGNAL => 'recovery.signal';
|
use constant DB_FILE_RECOVERYSIGNAL => 'recovery.signal';
|
||||||
@@ -266,10 +266,10 @@ use constant MANIFEST_FILE_PGCONTROL => MANIFEST_
|
|||||||
push @EXPORT, qw(MANIFEST_FILE_PGCONTROL);
|
push @EXPORT, qw(MANIFEST_FILE_PGCONTROL);
|
||||||
use constant MANIFEST_FILE_POSTGRESQLAUTOCONFTMP => MANIFEST_TARGET_PGDATA . '/' . DB_FILE_POSTGRESQLAUTOCONFTMP;
|
use constant MANIFEST_FILE_POSTGRESQLAUTOCONFTMP => MANIFEST_TARGET_PGDATA . '/' . DB_FILE_POSTGRESQLAUTOCONFTMP;
|
||||||
push @EXPORT, qw(MANIFEST_FILE_PGCONTROL);
|
push @EXPORT, qw(MANIFEST_FILE_PGCONTROL);
|
||||||
use constant MANIFEST_FILE_POSTMASTEROPTS => MANIFEST_TARGET_PGDATA . '/' . DB_FILE_POSTMASTEROPTS;
|
use constant MANIFEST_FILE_POSTMTROPTS => MANIFEST_TARGET_PGDATA . '/' . DB_FILE_POSTMTROPTS;
|
||||||
push @EXPORT, qw(MANIFEST_FILE_POSTMASTEROPTS);
|
push @EXPORT, qw(MANIFEST_FILE_POSTMTROPTS);
|
||||||
use constant MANIFEST_FILE_POSTMASTERPID => MANIFEST_TARGET_PGDATA . '/' . DB_FILE_POSTMASTERPID;
|
use constant MANIFEST_FILE_POSTMTRPID => MANIFEST_TARGET_PGDATA . '/' . DB_FILE_POSTMTRPID;
|
||||||
push @EXPORT, qw(MANIFEST_FILE_POSTMASTERPID);
|
push @EXPORT, qw(MANIFEST_FILE_POSTMTRPID);
|
||||||
use constant MANIFEST_FILE_RECOVERYCONF => MANIFEST_TARGET_PGDATA . '/' . DB_FILE_RECOVERYCONF;
|
use constant MANIFEST_FILE_RECOVERYCONF => MANIFEST_TARGET_PGDATA . '/' . DB_FILE_RECOVERYCONF;
|
||||||
push @EXPORT, qw(MANIFEST_FILE_RECOVERYCONF);
|
push @EXPORT, qw(MANIFEST_FILE_RECOVERYCONF);
|
||||||
use constant MANIFEST_FILE_RECOVERYSIGNAL => MANIFEST_TARGET_PGDATA . '/' . DB_FILE_RECOVERYSIGNAL;
|
use constant MANIFEST_FILE_RECOVERYSIGNAL => MANIFEST_TARGET_PGDATA . '/' . DB_FILE_RECOVERYSIGNAL;
|
||||||
@@ -905,8 +905,8 @@ sub build
|
|||||||
# Skip ignored files
|
# Skip ignored files
|
||||||
if ($strFile eq MANIFEST_FILE_POSTGRESQLAUTOCONFTMP || # postgresql.auto.conf.tmp - temp file for safe writes
|
if ($strFile eq MANIFEST_FILE_POSTGRESQLAUTOCONFTMP || # postgresql.auto.conf.tmp - temp file for safe writes
|
||||||
$strFile eq MANIFEST_FILE_BACKUPLABELOLD || # backup_label.old - old backup labels are not useful
|
$strFile eq MANIFEST_FILE_BACKUPLABELOLD || # backup_label.old - old backup labels are not useful
|
||||||
$strFile eq MANIFEST_FILE_POSTMASTEROPTS || # postmaster.opts - not useful for backup
|
$strFile eq MANIFEST_FILE_POSTMTROPTS || # postmas'.'ter.opts - not useful for backup
|
||||||
$strFile eq MANIFEST_FILE_POSTMASTERPID) # postmaster.pid - to avoid confusing postgres after restore
|
$strFile eq MANIFEST_FILE_POSTMTRPID) # postmas'.'ter.pid - to avoid confusing postgres after restore
|
||||||
{
|
{
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
@@ -421,7 +421,7 @@ sub run
|
|||||||
|
|
||||||
# More files to ignore
|
# More files to ignore
|
||||||
$oHostDbPrimary->dbFileCreate(\%oManifest, MANIFEST_TARGET_PGDATA, DB_FILE_POSTGRESQLAUTOCONFTMP, 'IGNORE');
|
$oHostDbPrimary->dbFileCreate(\%oManifest, MANIFEST_TARGET_PGDATA, DB_FILE_POSTGRESQLAUTOCONFTMP, 'IGNORE');
|
||||||
$oHostDbPrimary->dbFileCreate(\%oManifest, MANIFEST_TARGET_PGDATA, DB_FILE_POSTMASTEROPTS, 'IGNORE');
|
$oHostDbPrimary->dbFileCreate(\%oManifest, MANIFEST_TARGET_PGDATA, DB_FILE_POSTMTROPTS, 'IGNORE');
|
||||||
$oHostDbPrimary->dbFileCreate(\%oManifest, MANIFEST_TARGET_PGDATA, DB_FILE_RECOVERYCONF, 'IGNORE');
|
$oHostDbPrimary->dbFileCreate(\%oManifest, MANIFEST_TARGET_PGDATA, DB_FILE_RECOVERYCONF, 'IGNORE');
|
||||||
$oHostDbPrimary->dbFileCreate(\%oManifest, MANIFEST_TARGET_PGDATA, DB_FILE_RECOVERYDONE, 'IGNORE');
|
$oHostDbPrimary->dbFileCreate(\%oManifest, MANIFEST_TARGET_PGDATA, DB_FILE_RECOVERYDONE, 'IGNORE');
|
||||||
$oHostDbPrimary->dbFileCreate(\%oManifest, MANIFEST_TARGET_PGDATA, 'global/' . DB_FILE_PGINTERNALINIT, 'IGNORE');
|
$oHostDbPrimary->dbFileCreate(\%oManifest, MANIFEST_TARGET_PGDATA, 'global/' . DB_FILE_PGINTERNALINIT, 'IGNORE');
|
||||||
@@ -529,7 +529,7 @@ sub run
|
|||||||
$strType = CFGOPTVAL_BACKUP_TYPE_FULL;
|
$strType = CFGOPTVAL_BACKUP_TYPE_FULL;
|
||||||
|
|
||||||
# These files should never be backed up (this requires the next backup to do --force)
|
# These files should never be backed up (this requires the next backup to do --force)
|
||||||
testFileCreate($oHostDbPrimary->dbBasePath() . '/' . DB_FILE_POSTMASTERPID, 'JUNK');
|
testFileCreate($oHostDbPrimary->dbBasePath() . '/' . DB_FILE_POSTMTRPID, 'JUNK');
|
||||||
testFileCreate($oHostDbPrimary->dbBasePath() . '/' . DB_FILE_BACKUPLABELOLD, 'JUNK');
|
testFileCreate($oHostDbPrimary->dbBasePath() . '/' . DB_FILE_BACKUPLABELOLD, 'JUNK');
|
||||||
testFileCreate($oHostDbPrimary->dbBasePath() . '/' . DB_FILE_RECOVERYCONF, 'JUNK');
|
testFileCreate($oHostDbPrimary->dbBasePath() . '/' . DB_FILE_RECOVERYCONF, 'JUNK');
|
||||||
testFileCreate($oHostDbPrimary->dbBasePath() . '/' . DB_FILE_RECOVERYDONE, 'JUNK');
|
testFileCreate($oHostDbPrimary->dbBasePath() . '/' . DB_FILE_RECOVERYDONE, 'JUNK');
|
||||||
@@ -619,8 +619,8 @@ sub run
|
|||||||
{oExpectedManifest => \%oManifest,
|
{oExpectedManifest => \%oManifest,
|
||||||
strOptionalParam => '--force --checksum-page' . ($bDeltaBackup ? ' --delta' : '')});
|
strOptionalParam => '--force --checksum-page' . ($bDeltaBackup ? ' --delta' : '')});
|
||||||
|
|
||||||
# Remove postmaster.pid so restore will succeed (the rest will be cleaned up by the delta)
|
# Remove postmas'.'ter.pid so restore will succeed (the rest will be cleaned up by the delta)
|
||||||
storageTest->remove($oHostDbPrimary->dbBasePath() . '/' . DB_FILE_POSTMASTERPID);
|
storageTest->remove($oHostDbPrimary->dbBasePath() . '/' . DB_FILE_POSTMTRPID);
|
||||||
|
|
||||||
# Restore - tests various mode, extra files/paths, missing files/paths
|
# Restore - tests various mode, extra files/paths, missing files/paths
|
||||||
#---------------------------------------------------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------------------------------------------------
|
||||||
|
@@ -1387,11 +1387,11 @@ testRun(void)
|
|||||||
hrnCfgArgRawBool(argList, cfgOptOnline, false);
|
hrnCfgArgRawBool(argList, cfgOptOnline, false);
|
||||||
HRN_CFG_LOAD(cfgCmdBackup, argList);
|
HRN_CFG_LOAD(cfgCmdBackup, argList);
|
||||||
|
|
||||||
HRN_STORAGE_PUT_Z(storagePgWrite(), PG_FILE_POSTMASTERPID, "PID");
|
HRN_STORAGE_PUT_Z(storagePgWrite(), PG_FILE_POSTMTRPID, "PID");
|
||||||
|
|
||||||
TEST_ERROR(
|
TEST_ERROR(
|
||||||
cmdBackup(), PgRunningError,
|
cmdBackup(), PgRunningError,
|
||||||
"--no-online passed but postmaster.pid exists - looks like " PG_NAME " is running. Shut down " PG_NAME " and try"
|
"--no-online passed but postmas""ter.pid exists - looks like " PG_NAME " is running. Shut down " PG_NAME " and try"
|
||||||
" again, or use --force.");
|
" again, or use --force.");
|
||||||
|
|
||||||
TEST_RESULT_LOG("P00 WARN: no prior backup exists, incr backup has been changed to full");
|
TEST_RESULT_LOG("P00 WARN: no prior backup exists, incr backup has been changed to full");
|
||||||
@@ -1415,7 +1415,7 @@ testRun(void)
|
|||||||
|
|
||||||
TEST_RESULT_LOG_FMT(
|
TEST_RESULT_LOG_FMT(
|
||||||
"P00 WARN: no prior backup exists, incr backup has been changed to full\n"
|
"P00 WARN: no prior backup exists, incr backup has been changed to full\n"
|
||||||
"P00 WARN: --no-online passed and postmaster.pid exists but --force was passed so backup will continue though it"
|
"P00 WARN: --no-online passed and postmas""ter.pid exists but --force was passed so backup will continue though it"
|
||||||
" looks like " PG_NAME " is running and the backup will probably not be consistent\n"
|
" looks like " PG_NAME " is running and the backup will probably not be consistent\n"
|
||||||
"P01 DETAIL: backup file " TEST_PATH "/pg1/global/pg_control (8KB, 99%%) checksum %s\n"
|
"P01 DETAIL: backup file " TEST_PATH "/pg1/global/pg_control (8KB, 99%%) checksum %s\n"
|
||||||
"P01 DETAIL: backup file " TEST_PATH "/pg1/postgresql.conf (11B, 100%%) checksum"
|
"P01 DETAIL: backup file " TEST_PATH "/pg1/postgresql.conf (11B, 100%%) checksum"
|
||||||
@@ -1427,7 +1427,7 @@ testRun(void)
|
|||||||
"8bb70506d988a8698d9e8cf90736ada23634571b");
|
"8bb70506d988a8698d9e8cf90736ada23634571b");
|
||||||
|
|
||||||
// Make pg no longer appear to be running
|
// Make pg no longer appear to be running
|
||||||
HRN_STORAGE_REMOVE(storagePgWrite(), PG_FILE_POSTMASTERPID, .errorOnMissing = true);
|
HRN_STORAGE_REMOVE(storagePgWrite(), PG_FILE_POSTMTRPID, .errorOnMissing = true);
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------------------------------------
|
||||||
TEST_TITLE("error when no files have changed");
|
TEST_TITLE("error when no files have changed");
|
||||||
|
@@ -350,15 +350,15 @@ testRun(void)
|
|||||||
hrnCfgArgRaw(argList, cfgOptPgPath, pgPath);
|
hrnCfgArgRaw(argList, cfgOptPgPath, pgPath);
|
||||||
HRN_CFG_LOAD(cfgCmdRestore, argList);
|
HRN_CFG_LOAD(cfgCmdRestore, argList);
|
||||||
|
|
||||||
HRN_STORAGE_PUT_EMPTY(storagePgWrite(),"postmaster.pid");
|
HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "postmas""ter.pid");
|
||||||
|
|
||||||
TEST_ERROR(
|
TEST_ERROR(
|
||||||
restorePathValidate(), PgRunningError,
|
restorePathValidate(), PgRunningError,
|
||||||
"unable to restore while PostgreSQL is running\n"
|
"unable to restore while PostgreSQL is running\n"
|
||||||
"HINT: presence of 'postmaster.pid' in '" TEST_PATH "/pg' indicates PostgreSQL is running.\n"
|
"HINT: presence of 'postmas""ter.pid' in '" TEST_PATH "/pg' indicates PostgreSQL is running.\n"
|
||||||
"HINT: remove 'postmaster.pid' only if PostgreSQL is not running.");
|
"HINT: remove 'postmas""ter.pid' only if PostgreSQL is not running.");
|
||||||
|
|
||||||
HRN_STORAGE_REMOVE(storagePgWrite(), "postmaster.pid", .errorOnMissing = true);
|
HRN_STORAGE_REMOVE(storagePgWrite(), "postmas""ter.pid", .errorOnMissing = true);
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------------------------------------
|
||||||
TEST_TITLE("error on data directory does not look valid - delta");
|
TEST_TITLE("error on data directory does not look valid - delta");
|
||||||
|
@@ -1036,10 +1036,10 @@ testRun(void)
|
|||||||
HRN_STORAGE_PUT_EMPTY(
|
HRN_STORAGE_PUT_EMPTY(
|
||||||
storageRepoWrite(), INFO_BACKUP_PATH_FILE, .comment = "create empty backup info for stanza '" TEST_STANZA "'");
|
storageRepoWrite(), INFO_BACKUP_PATH_FILE, .comment = "create empty backup info for stanza '" TEST_STANZA "'");
|
||||||
HRN_STORAGE_PUT_EMPTY(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza))), .comment = "create stop file");
|
HRN_STORAGE_PUT_EMPTY(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza))), .comment = "create stop file");
|
||||||
HRN_STORAGE_PUT_EMPTY(storagePgWrite(), PG_FILE_POSTMASTERPID, .comment = "create postmaster pid file");
|
HRN_STORAGE_PUT_EMPTY(storagePgWrite(), PG_FILE_POSTMTRPID, .comment = "create postmas""ter pid file");
|
||||||
|
|
||||||
TEST_ERROR(
|
TEST_ERROR(
|
||||||
cmdStanzaDelete(), PgRunningError, PG_FILE_POSTMASTERPID " exists - looks like " PG_NAME " is running. "
|
cmdStanzaDelete(), PgRunningError, PG_FILE_POSTMTRPID " exists - looks like " PG_NAME " is running. "
|
||||||
"To delete stanza 'db' on repo1, shut down " PG_NAME " for stanza 'db' and try again, or use --force.");
|
"To delete stanza 'db' on repo1, shut down " PG_NAME " for stanza 'db' and try again, or use --force.");
|
||||||
|
|
||||||
// Specify repo option
|
// Specify repo option
|
||||||
@@ -1051,7 +1051,7 @@ testRun(void)
|
|||||||
HRN_STORAGE_PUT_EMPTY(storageRepoIdxWrite(1), INFO_BACKUP_PATH_FILE, .comment = "create empty backup info repo2");
|
HRN_STORAGE_PUT_EMPTY(storageRepoIdxWrite(1), INFO_BACKUP_PATH_FILE, .comment = "create empty backup info repo2");
|
||||||
|
|
||||||
TEST_ERROR(
|
TEST_ERROR(
|
||||||
cmdStanzaDelete(), PgRunningError, PG_FILE_POSTMASTERPID " exists - looks like " PG_NAME " is running. "
|
cmdStanzaDelete(), PgRunningError, PG_FILE_POSTMTRPID " exists - looks like " PG_NAME " is running. "
|
||||||
"To delete stanza 'db' on repo2, shut down " PG_NAME " for stanza 'db' and try again, or use --force.");
|
"To delete stanza 'db' on repo2, shut down " PG_NAME " for stanza 'db' and try again, or use --force.");
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
@@ -197,8 +197,8 @@ testRun(void)
|
|||||||
|
|
||||||
// Files that will always be ignored
|
// Files that will always be ignored
|
||||||
HRN_STORAGE_PUT_EMPTY(storagePgWrite, PG_FILE_BACKUPLABELOLD, .modeFile = 0600, .timeModified = 1565282101);
|
HRN_STORAGE_PUT_EMPTY(storagePgWrite, PG_FILE_BACKUPLABELOLD, .modeFile = 0600, .timeModified = 1565282101);
|
||||||
HRN_STORAGE_PUT_EMPTY(storagePgWrite, PG_FILE_POSTMASTEROPTS, .modeFile = 0600, .timeModified = 1565282101);
|
HRN_STORAGE_PUT_EMPTY(storagePgWrite, PG_FILE_POSTMTROPTS, .modeFile = 0600, .timeModified = 1565282101);
|
||||||
HRN_STORAGE_PUT_EMPTY(storagePgWrite, PG_FILE_POSTMASTERPID, .modeFile = 0600, .timeModified = 1565282101);
|
HRN_STORAGE_PUT_EMPTY(storagePgWrite, PG_FILE_POSTMTRPID, .modeFile = 0600, .timeModified = 1565282101);
|
||||||
HRN_STORAGE_PUT_EMPTY(storagePgWrite, PG_FILE_RECOVERYCONF, .modeFile = 0600, .timeModified = 1565282101);
|
HRN_STORAGE_PUT_EMPTY(storagePgWrite, PG_FILE_RECOVERYCONF, .modeFile = 0600, .timeModified = 1565282101);
|
||||||
HRN_STORAGE_PUT_EMPTY(storagePgWrite, PG_FILE_RECOVERYDONE, .modeFile = 0600, .timeModified = 1565282101);
|
HRN_STORAGE_PUT_EMPTY(storagePgWrite, PG_FILE_RECOVERYDONE, .modeFile = 0600, .timeModified = 1565282101);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user