postgresql/src
Andres Freund c8f621c43a logical decoding: Fix handling of large old tuples with replica identity full.
When decoding the old version of an UPDATE or DELETE change, and if that
tuple was bigger than MaxHeapTupleSize, we either Assert'ed out, or
failed in more subtle ways in non-assert builds.  Normally individual
tuples aren't bigger than MaxHeapTupleSize, with big datums toasted.
But that's not the case for the old version of a tuple for logical
decoding; the replica identity is logged as one piece. With the default
replica identity btree limits that to small tuples, but that's not the
case for FULL.

Change the tuple buffer infrastructure to separate allocate over-large
tuples, instead of always going through the slab cache.

This unfortunately requires changing the ReorderBufferTupleBuf
definition, we need to store the allocated size someplace. To avoid
requiring output plugins to recompile, don't store HeapTupleHeaderData
directly after HeapTupleData, but point to it via t_data; that leaves
rooms for the allocated size.  As there's no reason for an output plugin
to look at ReorderBufferTupleBuf->t_data.header, remove the field. It
was just a minor convenience having it directly accessible.

Reported-By: Adam Dratwiński
Discussion: CAKg6ypLd7773AOX4DiOGRwQk1TVOQKhNwjYiVjJnpq8Wo+i62Q@mail.gmail.com
2016-03-05 18:02:20 -08:00
..
backend logical decoding: Fix handling of large old tuples with replica identity full. 2016-03-05 18:02:20 -08:00
bin Expose control file data via SQL accessible functions. 2016-03-05 11:10:19 -08:00
common Expose control file data via SQL accessible functions. 2016-03-05 11:10:19 -08:00
include logical decoding: Fix handling of large old tuples with replica identity full. 2016-03-05 18:02:20 -08:00
interfaces Fix incorrect comment. 2016-03-01 13:31:44 -05:00
makefiles Fix typos in comments and doc 2016-01-28 16:47:36 +09:00
pl Add prefix to pl/pgsql global variables and functions 2016-03-03 10:45:59 +01:00
port Add new system view, pg_config 2016-02-17 09:12:06 -08:00
template Remove some remains from Alpha support removal 2015-10-29 16:40:14 -04:00
test Make stats regression test robust in the face of parallel query. 2016-03-04 16:20:49 -05:00
timezone Update time zone data files to tzdata release 2016a. 2016-02-05 10:59:09 -05:00
tools Expose control file data via SQL accessible functions. 2016-03-05 11:10:19 -08:00
tutorial Update copyright for 2016 2016-01-02 13:33:40 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Respect TEMP_CONFIG when pg_regress_check and friends are called 2016-02-27 12:28:21 -05:00
Makefile.shlib AIX: Link TRANSFORM modules with their dependencies. 2015-07-15 21:00:26 -04:00
nls-global.mk Setup error context callback for transaction lock waits 2014-03-19 15:10:36 -03:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00