Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts - Mailing list pgsql-bugs

From Andres Freund
Subject Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts
Date
Msg-id 20140720233125.GI5974@alap3.anarazel.de
Whole thread Raw
In response to Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On 2014-07-20 19:11:40 -0400, Tom Lane wrote:
> I wrote:
> > Andres Freund <andres@2ndquadrant.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).
>
> Oh, wait, I see what you're on about: that cutoff doesn't constrain
> the global value computed by vac_truncate_clog.  Hmm.
>
> I wonder whether we should change vac_update_relstats so that it only
> applies the "relminxid mustn't go backwards" rule as long as relminxid
> is sane, ie, not in the future.  If it is in the future, forcibly update
> it to the cutoff we actually used.  Likewise for relminmxid.  And I guess
> we'd need a similar rule for updating datmin(m)xid.

I'm wondering the same. How would we do that from a concurreny POV for
the pg_database rows? I think we could just accept the race condition
that two xacts move dbform->datminmxid backwards to different values
since both have to be 'somewhat' correct?

I think this is out of the remit for 9.3.5. At least I don't have the
mental capacity to do this properly till tomorrow afternoon.

Greetings,

Andres Freund

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

pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts
Next
From: Tom Lane
Date:
Subject: Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts