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

Commit923ae50

Browse files
committed
Add sanity check for dshash entries when reading pgstats file
Not having this check would produce a core dump at startup when runningpgstat_read_statsfile(), in the case where the information of a statskind for an entry in the dshash could not be found. The same checkalready happens for fixed-numbered stats and entries that are storedwith their names. This issue can be seen with custom stats kinds.Note that this problem can be reproduced what what is in the core code:- Tweak the test module injection_points to not load the fixed-numberedstats part, leaving only the variable-numbered stats.- Create an instance with injection_points defined inshared_preload_libraries.- Create a pgstats entry by attaching and running a point.- Restart the server without shared_preload_libraries. The startupprocess detects that something is wrong and reports a WARNING.Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>Discussion:https://postgr.es/m/aAieZAvM+K1d89R2@ip-10-97-1-34.eu-west-3.compute.internal
1 parentbc19f63 commit923ae50

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1905,6 +1905,14 @@ pgstat_read_statsfile(void)
19051905
key.objid,t);
19061906
gotoerror;
19071907
}
1908+
1909+
if (!pgstat_get_kind_info(key.kind))
1910+
{
1911+
elog(WARNING,"could not find information of kind for entry %u/%u/%"PRIu64" of type %c",
1912+
key.kind,key.dboid,
1913+
key.objid,t);
1914+
gotoerror;
1915+
}
19081916
}
19091917
else
19101918
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp