pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Kevin Grittner <kgrittn@ymail.com>
Cc: tgarnett@panjiva.com <tgarnett@panjiva.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #12990: Missing pg_multixact/members files (appears to have wrapped, then truncated)
Date: Mon, 27 Apr 2015 11:59:10 -0300
Message-ID: <20150427145909.GU4369@alvh.no-ip.org> (raw)
In-Reply-To: <CA+TgmoY5igs8i-B7BmQBeoJrK1U4b9Ym1SHzrjGaoUeC1aEHKg@mail.gmail.com>
References: <20150420190435.GV4369@alvh.no-ip.org>
	<682806730.1514266.1429650961503.JavaMail.yahoo@mail.yahoo.com>
	<CA+Tgmobw0YU4H43wKumPmwuyESH5H80ry3N0KYyup++ZRc7J9Q@mail.gmail.com>
	<CAEepm=1ZGLr0gHHWH7Uo+F2cVbm5NT2e=1wcYMyCPZSrfnScsw@mail.gmail.com>
	<20150424015905.GO4369@alvh.no-ip.org>
	<CA+TgmoY5igs8i-B7BmQBeoJrK1U4b9Ym1SHzrjGaoUeC1aEHKg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Robert Haas wrote:
> On Thu, Apr 23, 2015 at 9:59 PM, Alvaro Herrera
> <alvherre@2ndquadrant.com> wrote:
> > Thomas Munro wrote:
> >> That's why I proposed not using xid-like logic, and instead using a
> >> type of three-way comparison that allows you to see when nextOffset
> >> would 'cross' oldestOffsetStopLimit, instead of the two-way comparison
> >> that considers half the number-space to be in the past and half in the
> >> future, in my earlier message.
> >
> > Yeah, that bit made sense to me.
> 
> In addition to preventing the corruption, I think we also need a
> back-patchable fix for AV to try to keep this situation from happening
> in the first place.

Let me push a patch to fix the corruption, and then we can think of ways
to teach autovacuum about the problem.  I'm not optimistic about that,
honestly: as all GUC settings, these are individual for each process,
and there's no way for one process to affect the values that are seen by
other processes (autovac workers).  The only idea that comes to mind is
to publish values in shared memory, and autovac workers would read them
from there instead of using normal GUC values.

> What I think we should do is notice when members utilization exceeds
> offset utilization and progressively ramp back the effective value of
> autovacuum_multixact_freeze_max_age (and maybe also
> vacuum_multixact_freeze_table_age and vacuum_multixact_freeze_min_age)
> so that autovacuum (and maybe also manual vacuums) get progressively
> more aggressive about trying to advance relminmxid.  Suppose we decide
> that when the "members" space is 75% used, we've got a big problem and
> want to treat autovacuum_multixact_freeze_max_age to effectively be
> zero.

I think we can easily determine the rate of multixact member space
consumption and compare to the rate of multixact ID consumption;
considering the historical multixact size (number of members per
multixact) it would be possible to change the freeze ages by the same
fraction, so that autovac effectively behaves as if the members
consumption rate is what is driving the freezing instead of ID
consumption rate.  That way, we don't have to jump suddenly from
"normal" to "emergency" behavior as some fixed threshold.

> This may not be the right proposal in detail, but I think we should do
> something.

No disagreement on that.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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



view thread (113+ messages)  latest in thread

Message-ID: <20150427145909.GU4369@alvh.no-ip.org>
Permalink:  ../20150427145909.GU4369@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20150427145909.GU4369@alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: alvherre@2ndquadrant.com, robertmhaas@gmail.com, thomas.munro@enterprisedb.com, kgrittn@ymail.com, tgarnett@panjiva.com
  Subject: Re: BUG #12990: Missing pg_multixact/members files (appears to have wrapped, then truncated)
  In-Reply-To: <20150427145909.GU4369@alvh.no-ip.org>
  References: <20150420190435.GV4369@alvh.no-ip.org> <682806730.1514266.1429650961503.JavaMail.yahoo@mail.yahoo.com> <CA+Tgmobw0YU4H43wKumPmwuyESH5H80ry3N0KYyup++ZRc7J9Q@mail.gmail.com> <CAEepm=1ZGLr0gHHWH7Uo+F2cVbm5NT2e=1wcYMyCPZSrfnScsw@mail.gmail.com> <20150424015905.GO4369@alvh.no-ip.org> <CA+TgmoY5igs8i-B7BmQBeoJrK1U4b9Ym1SHzrjGaoUeC1aEHKg@mail.gmail.com> <20150427145909.GU4369@alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox