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

Commit734c057

Browse files
committed
Add assertion in pgstat_write_statsfile() about processes allowed
This routine can currently only be called from the postmaster insingle-user mode or the checkpointer, but there was no sanity check tomake sure that this was always the case.This has proved to be useful when hacking the zone (at least to me), tomake sure that the write of the pgstats file happens at shutdown, aswanted by design, in the correct process context.Discussion:https://postgr.es/m/ZnEiqAITL-VgZDoY@paquier.xyz
1 parent63909da commit734c057

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,9 @@ pgstat_write_statsfile(void)
13601360

13611361
pgstat_assert_is_up();
13621362

1363+
/* should be called only by the checkpointer or single user mode */
1364+
Assert(!IsUnderPostmaster||MyBackendType==B_CHECKPOINTER);
1365+
13631366
/* we're shutting down, so it's ok to just override this */
13641367
pgstat_fetch_consistency=PGSTAT_FETCH_CONSISTENCY_NONE;
13651368

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp