You've already forked pgbackrest
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:
@@ -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});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user