1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2026-05-22 10:15:16 +02:00

Changed log test order to ignore unimportant log errors while shutting down PostgreSQL.

This commit is contained in:
David Steele
2017-08-10 18:11:29 -04:00
parent 84caca0f34
commit ac1574448e
2 changed files with 17 additions and 7 deletions
@@ -467,13 +467,7 @@ sub clusterStop
# Disconnect user session
$self->sqlDisconnect();
# If postmaster process is running then stop the cluster
if (-e $self->dbBasePath() . '/' . DB_FILE_POSTMASTERPID)
{
$self->executeSimple($self->pgBinPath() . '/pg_ctl stop -D ' . $self->dbBasePath() . ' -w -s -m fast');
}
# Grep for errors in postgresql.log
# Grep for errors in postgresql.log - this is done first because we want to ignore any errors that happen during shutdown
if (!$bIgnoreLogError && storageTest()->exists($self->pgLogFile()))
{
$self->executeSimple(
@@ -481,6 +475,12 @@ sub clusterStop
{iExpectedExitStatus => 1});
}
# If postmaster process is running then stop the cluster
if (-e $self->dbBasePath() . '/' . DB_FILE_POSTMASTERPID)
{
$self->executeSimple($self->pgBinPath() . '/pg_ctl stop -D ' . $self->dbBasePath() . ' -w -s -m fast');
}
# Remove the log file
storageTest()->remove($self->pgLogFile(), {bIgnoreMissing => true});
}