postgresql/src/include/replication
Alvaro Herrera a19c262f3a Fix failure to delete spill files of aborted transactions
Logical decoding's reorderbuffer.c may spill transaction files to disk
when transactions are large.  These are supposed to be removed when they
become "too old" by xid; but file removal requires the boundary LSNs of
the transaction to be known.  The final_lsn is only set when we see the
commit or abort record for the transaction, but nothing sets the value
for transactions that crash, so the removal code misbehaves -- in
assertion-enabled builds, it crashes by a failed assertion.

To fix, modify the final_lsn of transactions that don't have a value
set, to the LSN of the very latest change in the transaction.  This
causes the spilled files to be removed appropriately.

Author: Atsushi Torikoshi
Reviewed-by: Kyotaro HORIGUCHI, Craig Ringer, Masahiko Sawada
Discussion: https://postgr.es/m/54e4e488-186b-a056-6628-50628e4e4ebc@lab.ntt.co.jp
2018-01-05 12:17:10 -03:00
..
basebackup.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
decode.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
logical.h Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
logicalfuncs.h Generate fmgr prototypes automatically 2017-01-17 14:06:07 -05:00
logicallauncher.h Only kill sync workers at commit time in subscription DDL 2017-08-04 21:17:47 -04:00
logicalproto.h Update copyright in recently added files 2017-07-26 18:17:18 -04:00
logicalrelation.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
logicalworker.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
message.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
origin.h Fix replication origin-related race conditions 2017-08-08 16:07:46 -04:00
output_plugin.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
pgoutput.h Update copyright in recently added files 2017-07-26 18:17:18 -04:00
reorderbuffer.h Fix failure to delete spill files of aborted transactions 2018-01-05 12:17:10 -03:00
slot.h Update code comment for temporary replication slots 2017-08-23 14:59:55 -04:00
snapbuild.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
syncrep.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
walreceiver.h Fix race condition with unprotected use of a latch pointer variable. 2017-10-03 14:00:57 -04:00
walsender.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
walsender_private.h Fix locking in WAL receiver/sender shmem state structs 2017-06-30 18:06:33 -04:00
worker_internal.h Only kill sync workers at commit time in subscription DDL 2017-08-04 21:17:47 -04:00