]> granicus.if.org Git - postgresql/commit
Fix autovacuum launcher shutdown sequence
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 8 Apr 2015 16:19:49 +0000 (13:19 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 8 Apr 2015 16:19:49 +0000 (13:19 -0300)
commit5df64f298d2863c9fb39437abb3ae6f988aedc0a
treedb5d59b85707b8d4b04b43f0a7ed934b0a1824ca
parente4f1e0d842fa8e52d5972b19677ede5c36f44e98
Fix autovacuum launcher shutdown sequence

It was previously possible to have the launcher re-execute its main loop
before shutting down if some other signal was received or an error
occurred after getting SIGTERM, as reported by Qingqing Zhou.

While investigating, Tom Lane further noticed that if autovacuum had
been disabled in the config file, it would misbehave by trying to start
a new worker instead of bailing out immediately -- it would consider
itself as invoked in emergency mode.

Fix both problems by checking the shutdown flag in a few more places.
These problems have existed since autovacuum was introduced, so
backpatch all the way back.
src/backend/postmaster/autovacuum.c