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

Commitc1201ff

Browse files
committed
Remove assertion based on pending_since in pgstat_report_stat()
This assertion, based on pending_since (timestamp used to prevent statsreports to be too frequent or should a partial flush happen), is reachedwhen it is found that no data can be flushed but a previous call ofpgstat_report_stat() determined that some stats data has been found asin need of a flush. So pending_since is set when some stats data ispending (in non-force mode) or if report attempts are too frequent, andreset to 0 once all stats have been flushed.Since5cbbe70, WAL senders have begun to report their stats on aperiodic basis for IO stats in v16~ and backend stats on HEAD, creatingsome friction with the concurrent pgstat_report_stat() calls that canhappen in the context of a WAL sender (shutdown callback doing a finalreport or backend-related code paths). This problem is the cause ofspurious failures in the TAP tests.In theory, this assertion can be also reached in v15, even if that'svery unlikely. For example, a process, say a background worker, coulddo periodic and direct stats flushes with concurrent calls ofpgstat_report_stat() that could cause conflicting values ofpending_since. This can be done with WAL or SLRU stats flushes usingpgstat_flush_wal() or pgstat_slru_flush(). HEAD makes this situationeasier to happen with custom cumulative stats.This commit removes the assertion altogether, per discussion, as it ismore useful to keep the state of things as they are for the WAL sender.The assertion could use a special state based on for exampleam_walsender, but I doubt that this would be meaningful in the long runbased on the other arguments raised while discussing this issue.Reported-by: Tom Lane <tgl@sss.pgh.pa.us>Reported-by: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/1489124.1744685908@sss.pgh.pa.usDiscussion:https://postgr.es/m/dwrkeszz6czvtkxzr5mqlciy652zau5qqnm3cp5f3p2po74ppk@omg4g3cc6dgqBackpatch-through: 15
1 parent9a5da12 commitc1201ff

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,6 @@ pgstat_report_stat(bool force)
592592
!have_slrustats&&
593593
!pgstat_have_pending_wal())
594594
{
595-
Assert(pending_since==0);
596595
return0;
597596
}
598597

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp