Обсуждение: Re: [ADMIN] Can postgres run autovacuum tasks when autovacuum is disabled?

Поиск
Список
Период
Сортировка

Re: [ADMIN] Can postgres run autovacuum tasks when autovacuum is disabled?

От
Tom Lane
Дата:
David G Johnston <david.g.johnston@gmail.com> writes:
> Scott Marlowe-2 wrote
>> Are you sure these aren't to prevent wrap-around?

> This is my other theory, and probably the correct one.  Is this something
> that can be discovered from the logs (since nothing in the query provides
> this detail)?

In all recent versions of Postgres, the pg_stat_activity line should
include "(to prevent wraparound)" if that's what autovac thinks it's
doing.

However ... it looks to me like if the autovac launcher gets launched
forcibly because of a possible wraparound issue, it will keep running
normally after that even if autovacuum is off :-(.  You need to SIGHUP
it to get it to quit again.  (A second bug is that it will then honor the
SIGHUP and quit, even if the wraparound emergency is still present.)

So I'm betting that what happened, particularly given the OP's apparent
insistence on managing vacuums manually, is that a wraparound vacuum
was forced on some relatively small table and then the launcher kept
doing its thing after that.  Since log_autovacuum_min_duration was
set to 0, there should be some evidence for this theory in the logs
(although it looks like the log entries *don't* say whether the
vacuum was for wraparound :-().

            regards, tom lane


Re: [ADMIN] Can postgres run autovacuum tasks when autovacuum is disabled?

От
Tom Lane
Дата:
I wrote:
> However ... it looks to me like if the autovac launcher gets launched
> forcibly because of a possible wraparound issue, it will keep running
> normally after that even if autovacuum is off :-(.

Nope, scratch that: I missed the bit before the launcher's main loop,
where it fires off one child and exits if it's launched when autovacuum
is already false.

Still, if it does fire one child process, it looks like that child will
vacuum everything that seems to need vacuuming in the target database.
We should probably adjust that so that tables not in danger of wraparound
get skipped.

            regards, tom lane


Re: [ADMIN] Can postgres run autovacuum tasks when autovacuum is disabled?

От
Andrey Zhidenkov
Дата:
Thank you for your fix. It is really seems that this bug appears only when some autovacuum jobs are active.

Andrey Zhidenkov.


On Wed, Jul 30, 2014 at 7:09 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
I wrote:
> However ... it looks to me like if the autovac launcher gets launched
> forcibly because of a possible wraparound issue, it will keep running
> normally after that even if autovacuum is off :-(.

Nope, scratch that: I missed the bit before the launcher's main loop,
where it fires off one child and exits if it's launched when autovacuum
is already false.

Still, if it does fire one child process, it looks like that child will
vacuum everything that seems to need vacuuming in the target database.
We should probably adjust that so that tables not in danger of wraparound
get skipped.

                        regards, tom lane


--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



--
С уважением, Андрей Жиденков.

                       _
ASCII ribbon campaign ( )
against HTML e-mail X
/ \