Re: Confusing comment in pg_upgrade in regards to VACUUM FREEZE - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Confusing comment in pg_upgrade in regards to VACUUM FREEZE
Date
Msg-id 20160418144621.GA560555@alvherre.pgsql
Whole thread Raw
In response to Re: Confusing comment in pg_upgrade in regards to VACUUM FREEZE  (Craig Ringer <craig@2ndquadrant.com>)
Responses Re: Confusing comment in pg_upgrade in regards to VACUUM FREEZE  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
Craig Ringer wrote:
> On 18 April 2016 at 12:11, David Rowley <david.rowley@2ndquadrant.com>
> wrote:
> 
> > this is not helping me much as I don't really understand why
> > pg_statistic need to be frozen?
> 
> Yeah, in particular it's not clear to me why pg_upgrade goes to such
> efforts to freeze everything when it copies pg_clog over in
> copy_clog_xlog_xid() .
> 
> Is it mainly a defense against the multixact format change?

Nothing to do with that.  The VACUUM FREEZE is executed on the new
database before migrating the old data over; it's there so that the
existing data has no trace of any permanent "normal" Xids from the
original counter.  Immediately afterwards we use pg_resetxlog to set the
counters to different values, and the normal values might be in a range
not covered by those, or they could even be marked aborted.  So a
visibility test would error out or return the wrong thing.

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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Refactor pg_dump as a library?
Next
From: Alvaro Herrera
Date:
Subject: Re: snapshot too old, configured by time