Re: Automatic autovacuum to prevent wraparound - PG13.5

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Mauro Farracha <farracha(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Automatic autovacuum to prevent wraparound - PG13.5
Date: 2022-06-15 14:27:22
Message-ID: 9babf7514fb0d98d55042552def28adf9eab9824.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2022-06-15 at 12:13 +0100, Mauro Farracha wrote:
> Have recently upgraded from PG10 to PG13.5 and would like to understand the reason why we
> are seeing triggered autovacuum to prevent the wraparound while all the metrics are still
> far off from the multixact/freeze max ages defined. And inclusive there was one time where
> it was triggered as aggressive.
>
> Some background:
> - autovacuum_freeze_max_age: 400M
> - autovacuum_multixact_freeze_max_age: 800M
> - the activity is mostly insert intensive in one particular table (60M daily)
> - the team execute vacuum freeze verbose every day at night to keep the multixact ids down
> - we generally reach near 70M mxids before running vacuum freeze at night
> - the postgresql is Aurora
>
> The scenario:
> - Out of nowhere (during the weekend), without database activity load or batches running,
> with previous nightly run of vacuum freeze, in the middle of the day, with xids and mxids
>  below 20M we are seeing autovacuum being triggered to prevent wraparound.
>
> My question is why this is occurring, which condition might be responsible for this behaviour?

A long-running transaction or a prepared transaction.
Or an abandoned replication slot with an old "xmin".

That would be the answer for PostgreSQL. It might apply to Amazon Aurora, unless they
changed the behavior there. Perhaps ask Amazon.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2022-06-15 15:21:25 Re: PostgreSQL 12.2 on Linux ubuntu 20.4 / s390
Previous Message Tom Lane 2022-06-15 13:48:59 Re: PostgreSQL 12.2 on Linux ubuntu 20.4 / s390