postgresql/contrib/test_decoding/sql
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
..
binary.sql test_decoding: Protect against rare spurious test failures. 2015-09-22 15:39:46 +02:00
ddl.sql logical decoding: old/newtuple in spooled UPDATE changes was switched around. 2016-03-05 18:02:20 -08:00
decoding_in_xact.sql Collection of typo fixes. 2015-05-20 16:56:22 +03:00
decoding_into_rel.sql Don't skip SQL backends in logical decoding for visibility computation. 2014-12-02 23:47:08 +01:00
permissions.sql Add skip-empty-xacts option to test_decoding for use in the regression tests. 2014-09-01 15:59:44 +02:00
prepared.sql Add skip-empty-xacts option to test_decoding for use in the regression tests. 2014-09-01 15:59:44 +02:00
replorigin.sql Introduce replication progress tracking infrastructure. 2015-04-29 19:30:53 +02:00
rewrite.sql Add skip-empty-xacts option to test_decoding for use in the regression tests. 2014-09-01 15:59:44 +02:00
time.sql logical decoding: fix decoding of a commit's commit time. 2016-03-02 23:42:21 -08:00
toast.sql logical decoding: Fix handling of large old tuples with replica identity full. 2016-03-05 18:02:20 -08:00
xact.sql logical decoding: Tell reorderbuffer about all xids. 2016-03-05 18:02:20 -08:00