Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit03c7f1f

Browse files
author
Amit Kapila
committed
Fix inconsistency in determining the timestamp of the db statfile.
We use the timestamp of the global statfile if we are not able todetermine it for a particular database in case the entry for that databasedoesn't exist. However, we were using it even when the statfile iscorrupt.As there is no user reported issue and it is not clear if there is anyimpact of this on actual application so decided not to backpatch.Reported-by: Amit KapilaAuthor: Amit KapilaReviewed-by: Sawada Masahiko, Magnus Hagander and Alvaro HerreraDiscussion:https://postgr.es/m/CAA4eK1J3oTJKyVq6v7K4d3jD+vtnruG9fHRib6UuWWsrwAR6Aw@mail.gmail.com
1 parentddd5f6d commit03c7f1f

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

‎src/backend/postmaster/pgstat.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5557,7 +5557,8 @@ pgstat_read_db_statsfile(Oid databaseid, HTAB *tabhash, HTAB *funchash,
55575557
* pgstat_read_db_statsfile_timestamp() -
55585558
*
55595559
*Attempt to determine the timestamp of the last db statfile write.
5560-
*Returns true if successful; the timestamp is stored in *ts.
5560+
*Returns true if successful; the timestamp is stored in *ts. The caller must
5561+
*rely on timestamp stored in *ts iff the function returns true.
55615562
*
55625563
*This needs to be careful about handling databases for which no stats file
55635564
*exists, such as databases without a stat entry or those not yet written:
@@ -5665,7 +5666,8 @@ pgstat_read_db_statsfile_timestamp(Oid databaseid, bool permanent,
56655666
ereport(pgStatRunningInCollector ?LOG :WARNING,
56665667
(errmsg("corrupted statistics file \"%s\"",
56675668
statfile)));
5668-
gotodone;
5669+
FreeFile(fpin);
5670+
return false;
56695671
}
56705672

56715673
/*
@@ -5684,10 +5686,13 @@ pgstat_read_db_statsfile_timestamp(Oid databaseid, bool permanent,
56845686
gotodone;
56855687

56865688
default:
5687-
ereport(pgStatRunningInCollector ?LOG :WARNING,
5688-
(errmsg("corrupted statistics file \"%s\"",
5689-
statfile)));
5690-
gotodone;
5689+
{
5690+
ereport(pgStatRunningInCollector ?LOG :WARNING,
5691+
(errmsg("corrupted statistics file \"%s\"",
5692+
statfile)));
5693+
FreeFile(fpin);
5694+
return false;
5695+
}
56915696
}
56925697
}
56935698

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp