Re: logical decoding bug when mapped relation with toast contents isrewritten repeatedly - Mailing list pgsql-hackers

From Andres Freund
Subject Re: logical decoding bug when mapped relation with toast contents isrewritten repeatedly
Date
Msg-id 20180921024124.bz6hdrpbmlsnwspz@alap3.anarazel.de
Whole thread Raw
In response to Re: logical decoding bug when mapped relation with toast contents isrewritten repeatedly  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List pgsql-hackers
Hi,

On 2018-09-14 16:13:46 +0200, Tomas Vondra wrote:
> > 
> > I suspect the proper fix would be to have a new HEAP_INSERT_NO_LOGICAL
> > option, and specify that in raw_heap_insert() iff
> > RelationIsLogicallyLogged(state->rs_old_rel) or something like that.
> > 
> > Attached is a *prototype* patch of that approach.  Without the code
> > level changes the addition to test_decoding's rewrite.sql trigger the
> > bug, after it they're fixed.
> > 
> > 
> > The only reason the scenario I was debugging hit this was that there was
> > a cluster wide VACUUM FULL a couple times a day, and replication was
> > several hours behind due to slow network / receiving side.
> > 
> > 
> > Now I'm having a beer outside.

> Yeah, that seems like a bad idea. That error already caught a couple of
> bugs (including da10d6a8a9 and this one), and I have a hunch those are
> not the last ones.

One problem with this is that that means upgrading won't fix an existing
instance of the problem, but turning the ERROR into a WARNING would. I
personally think that's *NOT* enough justification for relaxing the
error, given that recreating the slot would fix the issue, but I see how
other people can reasonably differ.  I can't really see a reasonably
complex approach that solves the issue in a "cake but have it too"
way...


> After discarding 30 theories? Have two.

I will neither confirm nor deny. ;)


Greetings,

Andres Freund


pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Strange failure in LWLock on skink in REL9_5_STABLE
Next
From: Tom Lane
Date:
Subject: Re: Strange failure in LWLock on skink in REL9_5_STABLE