Commit 746ba76
committed
Avoid useless respawining the autovacuum launcher at high speed.
When (1) autovacuum = off and (2) there's at least one database with
an XID age greater than autovacuum_freeze_max_age and (3) all tables
in that database that need vacuuming are already being processed by a
worker and (4) the autovacuum launcher is started, a kind of infinite
loop occurs. The launcher starts a worker and immediately exits. The
worker, finding no worker to do, immediately starts the launcher,
supposedly so that the next database can be processed. But because
datfrozenxid for that database hasn't been advanced yet, the new
worker gets put right back into the same database as the old one,
where it once again starts the launcher and exits. High-speed ping
pong ensues.
There are several possible ways to break the cycle; this seems like
the safest one.
Amit Khandekar (code) and Robert Haas (comments), reviewed by
Álvaro Herrera.
Discussion: http://postgr.es/m/CAJ3gD9eWejf72HKquKSzax0r+epS=nAbQKNnykkMA0E8c+rMDg@mail.gmail.com1 parent fd081ca commit 746ba76
1 file changed
+23
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1895 | 1895 | | |
1896 | 1896 | | |
1897 | 1897 | | |
| 1898 | + | |
| 1899 | + | |
1898 | 1900 | | |
1899 | 1901 | | |
1900 | 1902 | | |
| |||
2233 | 2235 | | |
2234 | 2236 | | |
2235 | 2237 | | |
| 2238 | + | |
2236 | 2239 | | |
2237 | 2240 | | |
2238 | 2241 | | |
| |||
2359 | 2362 | | |
2360 | 2363 | | |
2361 | 2364 | | |
| 2365 | + | |
| 2366 | + | |
2362 | 2367 | | |
2363 | 2368 | | |
2364 | 2369 | | |
| |||
2396 | 2401 | | |
2397 | 2402 | | |
2398 | 2403 | | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
2399 | 2420 | | |
2400 | | - | |
| 2421 | + | |
| 2422 | + | |
2401 | 2423 | | |
2402 | 2424 | | |
2403 | 2425 | | |
| |||
0 commit comments