1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +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

View File

@ -163,6 +163,16 @@
</contributor-list>
<release-list>
<release date="XXXX-XX-XX" version="1.23dev" title="UNDER DEVELOPMENT">
<release-test-list>
<release-bug-list>
<release-item>
<p>Changed log test order to ignore unimportant log errors while shutting down <postgres/>.</p>
</release-item>
</release-bug-list>
</release-test-list>
</release>
<release date="2017-08-09" version="1.22" title="Fixed S3 Retry">
<release-core-list>
<release-bug-list>

View File

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