postgresql/src/include/replication
Amit Kapila 4daa140a2f Fix decoding of speculative aborts.
During decoding for speculative inserts, we were relying for cleaning
toast hash on confirmation records or next change records. But that
could lead to multiple problems (a) memory leak if there is neither a
confirmation record nor any other record after toast insertion for a
speculative insert in the transaction, (b) error and assertion failures
if the next operation is not an insert/update on the same table.

The fix is to start queuing spec abort change and clean up toast hash
and change record during its processing. Currently, we are queuing the
spec aborts for both toast and main table even though we perform cleanup
while processing the main table's spec abort record. Later, if we have a
way to distinguish between the spec abort record of toast and the main
table, we can avoid queuing the change for spec aborts of toast tables.

Reported-by: Ashutosh Bapat
Author: Dilip Kumar
Reviewed-by: Amit Kapila
Backpatch-through: 9.6, where it was introduced
Discussion: https://postgr.es/m/CAExHW5sPKF-Oovx_qZe4p5oM6Dvof7_P+XgsNAViug15Fm99jA@mail.gmail.com
2021-06-15 08:28:36 +05:30
..
backup_manifest.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
basebackup.h Code review for server's handling of "tablespace map" files. 2021-03-17 16:18:46 -04:00
decode.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
logical.h Revert recovery prefetching feature. 2021-05-10 16:06:09 +12:00
logicallauncher.h Allow multiple xacts during table sync in logical replication. 2021-02-12 07:41:51 +05:30
logicalproto.h Allow pgoutput to send logical decoding messages. 2021-04-06 08:40:47 +05:30
logicalrelation.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
logicalworker.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
message.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
origin.h Add some const decorations 2021-06-10 16:21:48 +02:00
output_plugin.h Add a xid argument to the filter_prepare callback for output plugins. 2021-03-30 10:34:43 +05:30
pgoutput.h Allow pgoutput to send logical decoding messages. 2021-04-06 08:40:47 +05:30
reorderbuffer.h Fix decoding of speculative aborts. 2021-06-15 08:28:36 +05:30
slot.h Return ReplicationSlotAcquire API to its original form 2021-06-11 15:48:26 -04:00
snapbuild.h Avoid repeated decoding of prepared transactions after a restart. 2021-03-01 09:11:18 +05:30
syncrep.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
walreceiver.h Add condition variable for walreceiver shutdown. 2021-03-12 19:45:42 +13:00
walsender.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
walsender_private.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
worker_internal.h Rename the logical replication global "wrconn" 2021-05-12 19:13:54 -04:00