forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb2355a2
committed
Ensure that backends see up-to-date statistics for shared catalogs.
Ever since we split the statistics collector's reports into per-databasefiles (commit187492b), backends have been seeing stale statisticsfor shared catalogs. This is because the inquiry message only prompts thecollector to write the per-database file for the requesting backend's owndatabase. Stats for shared catalogs are in a separate file for "DB 0",which didn't get updated.In normal operation this was partially masked by the fact that theautovacuum launcher would send an inquiry message at least once perautovacuum_naptime that asked for "DB 0"; so the shared-catalog stats wouldnever be more than a minute out of date. However the problem becomes veryobvious with autovacuum disabled, as reported by Peter Eisentraut.To fix, redefine the semantics of inquiry messages so that both thespecified DB and DB 0 will be dumped. (This might seem a bit inefficient,but we have no good way to know whether a backend's transaction will lookat shared-catalog stats, so we have to read both groups of stats wheneverwe request stats. Sending two inquiry messages would definitely not bebetter.)Back-patch to 9.3 where the bug was introduced.Report: <56AD41AC.1030509@gmx.net>1 parentaf6555b commitb2355a2
1 file changed
+10
-1
lines changedLines changed: 10 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5351 | 5351 |
| |
5352 | 5352 |
| |
5353 | 5353 |
| |
5354 |
| - | |
| 5354 | + | |
| 5355 | + | |
| 5356 | + | |
| 5357 | + | |
| 5358 | + | |
| 5359 | + | |
| 5360 | + | |
| 5361 | + | |
| 5362 | + | |
| 5363 | + | |
5355 | 5364 |
| |
5356 | 5365 |
| |
5357 | 5366 |
| |
|
0 commit comments
Comments
(0)