Re: postgres 9.4.5 - pg_serial not decreasing

From: Kevin Grittner <kgrittn(at)gmail(dot)com>
To: Alexandre Garcia <alexandre(at)vmfarms(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: postgres 9.4.5 - pg_serial not decreasing
Date: 2016-06-07 20:01:02
Message-ID: CACjxUsON4Vya3a6r=ubwmN-4qTDDfZjuwSzjnL1QjdUc8_gzLw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, Jun 7, 2016 at 1:23 PM, Alexandre Garcia <alexandre(at)vmfarms(dot)com> wrote:

> Few weeks ago our customer experienced some spikes on his Postgres 9.4.5
> database. We've been alerted of a significant disk usage increase and
> pg_serial seemed to be the culprit.
>
> We noticed a lot of those errors in the logs
>
> " could not truncate directory "pg_serial": apparent wraparound "
>
> No more errors now but the pg_serial is still 8G big and doesn't seem to
> decrease.
> The only thing I could find related to this was an old bug from 2011 which
> might be fixed now.
>
> We wonder what is responsible for cleaning up the old transactions in
> pg_serial and how it could dysfunction in this case.

Could you check your logs to see whether you got a warning like this?:

memory for serializable conflict tracking is nearly exhausted

With a hint like this?:

There might be an idle transaction or a forgotten prepared
transaction causing this.

Please check pg_stat_activity and pg_prepared_xacts for very old
transactions. You should not see the errors you are reporting nor
the warning I mentioned unless a serializable transaction remains
active long enough for about 1 billion transaction IDs to be
consumed.

Hm. WARNING is probably not the right level for that, since that
might not show in the log. It should probably be changed to LOG.
Even better, now that filenames can go past 4 hex digits, we should
eliminate the 1 billion limit for this.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Alexandre Garcia 2016-06-07 20:24:12 Re: postgres 9.4.5 - pg_serial not decreasing
Previous Message Max Kremer 2016-06-07 19:45:21 Planner is ignoring index when view is queried but uses index when running underlying view's sql