forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9a8dd2c
committed
Improve check for detection of pending data in backend statistics
The callback pgstat_backend_have_pending_cb() is used as a way forpg_stat_report() to detect if there is any pending data for backendstatistics.It did not include a check based on pgstat_tracks_backend_bktype(), thatdiscards processes whose backend types do not support backendstatistics. The logic is not a problem on HEAD, as processes that donot support backend statistics cannot touch PendingBackendStats, so thecallback would always report that there is no pending data in this case.However, we would run into trouble once backend statistics includeportions of pending stats that are not always zeroed, like pgWalUsage.There is no reason for pgstat_backend_have_pending_cb() to not checkfor pgstat_tracks_backend_bktype(), anyway, and this pattern is safer inthe long run, so let's update the code to do so.While on it, this commit adds a proper initialization toPendingBackendStats.Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>Co-authored-by: Michael Paquier <michael@paquier.xyz>Discussion:https://postgr.es/m/Z8l6EMM4ImVoWRkg@ip-10-97-1-34.eu-west-3.compute.internal1 parent8e167e6 commit9a8dd2c
1 file changed
+4
-1
lines changedLines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
39 |
| - | |
| 39 | + | |
40 | 40 |
| |
41 | 41 |
| |
42 | 42 |
| |
| |||
222 | 222 |
| |
223 | 223 |
| |
224 | 224 |
| |
| 225 | + | |
| 226 | + | |
| 227 | + | |
225 | 228 |
| |
226 | 229 |
| |
227 | 230 |
| |
|
0 commit comments
Comments
(0)