Re: Incomplete freezing when truncating a relation during vacuum

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Incomplete freezing when truncating a relation during vacuum
Date: 2013-12-01 22:58:48
Message-ID: 20131201225848.GB11887@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-12-01 15:54:41 -0500, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> schrieb:
> >> Uh ... what does the last have to do with it? Surely we don't run
> >> VACUUM on replicas. Or are you talking about what might happen when
> >> VACUUM is run on a former replica that's been promoted to master?
>
> > Unfortunately not. The problem is that xl_heap_freeze's redo function simply reexecutes heap-freeze-tuple() instead of logging much about each tuple...
>
> That was a pretty stupid choice ... we should think seriously about
> changing that for 9.4. In general the application of a WAL record
> needs to be 100% deterministic.

Completely agreed. I'm not really sure what led to that design choice
except the desire to save a bit of WAL volume. It's a pretty old piece
of code - a good while before I followed development in any form of
detail.
It's actually in the original commit
(48188e1621bb6711e7d092bee48523b18cd80177) that introduced today's form
of freezing.

If it had been a more robust format all along, potential damage from the
replication bug could have been fixed by a VACUUM FREEZE...

Greetings,

Andres Freund

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-12-01 23:02:27 Re: Incomplete freezing when truncating a relation during vacuum
Previous Message Andres Freund 2013-12-01 22:54:06 Re: Incomplete freezing when truncating a relation during vacuum