- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitc1201ff
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: 151 parent9a5da12 commitc1201ff
1 file changed
+0
-1
lines changedLines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
592 | 592 |
| |
593 | 593 |
| |
594 | 594 |
| |
595 |
| - | |
596 | 595 |
| |
597 | 596 |
| |
598 | 597 |
| |
|
0 commit comments
Comments
(0)