From 8cf28af505ce719e97efd05f1f1111ea1922695d Mon Sep 17 00:00:00 2001 From: Masahiko Sawada Date: Tue, 8 Sep 2020 11:14:52 +0900 Subject: [PATCH 1/2] Return true when failing to read SLRU or Archiver stats from stats file. --- src/backend/postmaster/pgstat.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index 5f4b168fd1..3c14e646e8 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -5620,6 +5620,9 @@ pgstat_read_db_statsfile_timestamp(Oid databaseid, bool permanent, return false; } + /* By default, we're going to return the timestamp of the global file. */ + *ts = myGlobalStats.stats_timestamp; + /* * Read archiver stats struct */ @@ -5629,7 +5632,7 @@ pgstat_read_db_statsfile_timestamp(Oid databaseid, bool permanent, ereport(pgStatRunningInCollector ? LOG : WARNING, (errmsg("corrupted statistics file \"%s\"", statfile))); FreeFile(fpin); - return false; + return true; } /* @@ -5640,12 +5643,9 @@ pgstat_read_db_statsfile_timestamp(Oid databaseid, bool permanent, ereport(pgStatRunningInCollector ? LOG : WARNING, (errmsg("corrupted statistics file \"%s\"", statfile))); FreeFile(fpin); - return false; + return true; } - /* By default, we're going to return the timestamp of the global file. */ - *ts = myGlobalStats.stats_timestamp; - /* * We found an existing collector stats file. Read it and look for a * record for the requested database. If found, use its timestamp. -- 2.27.0