Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts
Date: 2014-07-20 23:12:14
Message-ID: 20140720231214.GH5974@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2014-07-20 19:04:30 -0400, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > If any *single* full table vacuum after that calls
> > vac_update_datfrozenxid() which just needs its datfrozenxid advance by
> > one we're in trouble: vac_truncate_clog() will be called with minMulti =
> > GetOldestMultiXactId().
>
> Uh, no, the cutoff is GetOldestMultiXactId minus
> vacuum_multixact_freeze_min_age (or the autovac equivalent).
> See vacuum_set_xid_limits.

Unfortunately not :(. The stuff computed in vacuum_set_xid_limits isn't
used for truncation - which normally is sane because another database
might be further behind.

void
vac_update_datfrozenxid(void)
{
...
MultiXactId newMinMulti;
...
/*
* Similarly, initialize the MultiXact "min" with the value that would be
* used on pg_class for new tables. See AddNewRelationTuple().
*/
newMinMulti = GetOldestMultiXactId();
...
while ((classTup = systable_getnext(scan)) != NULL)
{
...
if (MultiXactIdPrecedes(classForm->relminmxid, newMinMulti))
newMinMulti = classForm->relminmxid;
}
...
if (dirty || ForceTransactionIdLimitUpdate())
vac_truncate_clog(newFrozenXid, newMinMulti);
}

But even if it were, I don't really see how that changes anything?

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2014-07-20 23:31:25 Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts
Previous Message Tom Lane 2014-07-20 23:11:40 Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts