Re: logical decoding bug when mapped relation with toast contents is rewritten repeatedly
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org, Tomas Vondra <tv@fuzzy.cz>
Date: 2018-09-21T02:41:24Z
Lists: 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
Commits
-
Fix logical decoding error when system table w/ toast is repeatedly rewritten.
- c7b96ba29159 9.4.20 landed
- 0a0c25594243 9.5.15 landed
- e9edc1ba0be2 12.0 landed
- a88482dd24aa 9.6.11 landed
- 88670a436611 11.0 landed
- 532e3b5b3dd2 10.6 landed