forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3f1db99
committed
Handle auxiliary processes in SQL functions of backend statistics
This commit impacts the following SQL functions, authorizing the accessto the PGPROC entries of auxiliary processes when attempting to fetch orreset backend-level pgstats entries:- pg_stat_reset_backend_stats()- pg_stat_get_backend_io()This is relevant sincea051e71 for at least the WAL summarizer, WALreceiver and WAL writer processes, that has changed the backendstatistics to authorize these three following the addition of WAL I/Ostatistics in pg_stat_io and backend statistics. The code is moreflexible with future changes written this way, adapting automatically toany updates done in pgstat_tracks_backend_bktype().While on it, pgstat_report_wal() gains a call to pgstat_flush_backend(),making sure that backend I/O statistics are updated when calling thisroutine. This makes the statistics report correctly for the WAL writer.WAL receiver and WAL summarizer do not call pgstat_report_wal() yet(spoiler: both should). It should be possible to lift some of theexisting restrictions for other auxiliary processes, as well, but thisis left as future work.Reported-by: Rahila Syed <rahilasyed90@gmail.com>Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>Discussion:https://postgr.es/m/CAH2L28v9BwN8_y0k6FQ591=0g2Hj_esHLGj3bP38c9nmVykoiA@mail.gmail.com1 parentfe186bd commit3f1db99
File tree
3 files changed
+26
-15
lines changed- src/backend/utils
- activity
- adt
3 files changed
+26
-15
lines changedLines changed: 8 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
103 | 103 |
| |
104 | 104 |
| |
105 | 105 |
| |
106 |
| - | |
107 |
| - | |
108 |
| - | |
109 |
| - | |
110 |
| - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
111 | 110 |
| |
112 | 111 |
| |
113 | 112 |
| |
| |||
117 | 116 |
| |
118 | 117 |
| |
119 | 118 |
| |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
120 | 123 |
| |
121 | 124 |
| |
122 | 125 |
| |
| |||
125 | 128 |
| |
126 | 129 |
| |
127 | 130 |
| |
128 |
| - | |
129 |
| - | |
130 |
| - | |
131 |
| - | |
132 | 131 |
| |
133 | 132 |
| |
134 | 133 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
55 | 55 |
| |
56 | 56 |
| |
57 | 57 |
| |
| 58 | + | |
58 | 59 |
| |
59 | 60 |
| |
60 | 61 |
| |
|
Lines changed: 17 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1919 | 1919 |
| |
1920 | 1920 |
| |
1921 | 1921 |
| |
| 1922 | + | |
| 1923 | + | |
1922 | 1924 |
| |
1923 | 1925 |
| |
1924 | 1926 |
| |
1925 | 1927 |
| |
1926 |
| - | |
1927 |
| - | |
1928 |
| - | |
1929 |
| - | |
1930 |
| - | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
1931 | 1932 |
| |
1932 | 1933 |
| |
1933 | 1934 |
| |
1934 |
| - | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
1935 | 1946 |
| |
1936 | 1947 |
| |
1937 | 1948 |
| |
|
0 commit comments
Comments
(0)