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

Commit001a537

Browse files
committed
Improve comment about dropped entries in pgstat.c
pgstat_write_statsfile() discards any entries marked as dropped frombeing written to the stats file at shutdown, and also included anassertion based on the same condition.The intention of the assertion is to track that no pgstats entriesshould be left around as terminating backends should drop any entriesthey still hold references on before the stats file is written by thecheckpointer, and it not worth taking down the server in this case ifthere is a bug making that possible.Let's improve the comment of this area to document clearly what'sintended.Based on a discussion with Bertrand Drouvot and Anton A. Melnikov.Author: Bertrand DrouvotDiscussion:https://postgr.es/m/a13e8cdf-b97a-4ecb-8f42-aaa367974e29@postgrespro.ruBackpatch-through: 15
1 parent2d0152d commit001a537

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎src/backend/utils/activity/pgstat.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,15 @@ pgstat_write_statsfile(XLogRecPtr redo)
16551655

16561656
CHECK_FOR_INTERRUPTS();
16571657

1658-
/* we may have some "dropped" entries not yet removed, skip them */
1658+
/*
1659+
* We should not see any "dropped" entries when writing the stats
1660+
* file, as all backends and auxiliary processes should have cleaned
1661+
* up their references before they terminated.
1662+
*
1663+
* However, since we are already shutting down, it is not worth
1664+
* crashing the server over any potential cleanup issues, so we simply
1665+
* skip such entries if encountered.
1666+
*/
16591667
Assert(!ps->dropped);
16601668
if (ps->dropped)
16611669
continue;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp