postgresql/contrib/test_decoding
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
..
expected logical decoding: Fix handling of large old tuples with replica identity full. 2016-03-05 18:02:20 -08:00
specs Force synchronous_commit=on in test_decoding's concurrent_ddl_dml.spec. 2016-03-03 17:22:25 -08:00
sql logical decoding: Fix handling of large old tuples with replica identity full. 2016-03-05 18:02:20 -08:00
.gitignore test_decoding: Update .gitignore 2014-03-31 14:18:35 -04:00
Makefile logical decoding: Tell reorderbuffer about all xids. 2016-03-05 18:02:20 -08:00
logical.conf Introduce logical decoding. 2014-03-03 16:32:18 -05:00
test_decoding.c Update copyright for 2016 2016-01-02 13:33:40 -05:00