pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix failure to delete spill files of aborted transactions
5+ messages / 1 participants
[nested] [flat]

* pgsql: Fix failure to delete spill files of aborted transactions
@ 2018-01-05 15:17 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Alvaro Herrera @ 2018-01-05 15:17 UTC (permalink / raw)
  To: pgsql-committers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/df9f682c7bf81674b6ae3900fd0146f35df0ae2e

Modified Files
--------------
src/backend/replication/logical/reorderbuffer.c | 19 +++++++++++++++++--
src/include/replication/reorderbuffer.h         |  2 ++
2 files changed, 19 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix failure to delete spill files of aborted transactions
@ 2018-01-05 15:17 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Alvaro Herrera @ 2018-01-05 15:17 UTC (permalink / raw)
  To: pgsql-committers

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

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a19c262f3a013065429462c7a322eebf3f7e3771

Modified Files
--------------
src/backend/replication/logical/reorderbuffer.c | 19 +++++++++++++++++--
src/include/replication/reorderbuffer.h         |  2 ++
2 files changed, 19 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix failure to delete spill files of aborted transactions
@ 2018-01-05 15:17 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Alvaro Herrera @ 2018-01-05 15:17 UTC (permalink / raw)
  To: pgsql-committers

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

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9a5e4a6e08faf68f9fbc1e15eeade46fd7b1d7e0

Modified Files
--------------
src/backend/replication/logical/reorderbuffer.c | 19 +++++++++++++++++--
src/include/replication/reorderbuffer.h         |  2 ++
2 files changed, 19 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix failure to delete spill files of aborted transactions
@ 2018-01-05 15:17 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Alvaro Herrera @ 2018-01-05 15:17 UTC (permalink / raw)
  To: pgsql-committers

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

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/132cd58d6dc5c2ea4a64f8cadd05e922f6342bfa

Modified Files
--------------
src/backend/replication/logical/reorderbuffer.c | 19 +++++++++++++++++--
src/include/replication/reorderbuffer.h         |  2 ++
2 files changed, 19 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix failure to delete spill files of aborted transactions
@ 2018-01-05 15:17 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Alvaro Herrera @ 2018-01-05 15:17 UTC (permalink / raw)
  To: pgsql-committers

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

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f68c49f86aea271a083f26147a8648ac74ed2e76

Modified Files
--------------
src/backend/replication/logical/reorderbuffer.c | 19 +++++++++++++++++--
src/include/replication/reorderbuffer.h         |  2 ++
2 files changed, 19 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2018-01-05 15:17 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-01-05 15:17 pgsql: Fix failure to delete spill files of aborted transactions Alvaro Herrera <alvherre@alvh.no-ip.org>
2018-01-05 15:17 pgsql: Fix failure to delete spill files of aborted transactions Alvaro Herrera <alvherre@alvh.no-ip.org>
2018-01-05 15:17 pgsql: Fix failure to delete spill files of aborted transactions Alvaro Herrera <alvherre@alvh.no-ip.org>
2018-01-05 15:17 pgsql: Fix failure to delete spill files of aborted transactions Alvaro Herrera <alvherre@alvh.no-ip.org>
2018-01-05 15:17 pgsql: Fix failure to delete spill files of aborted transactions Alvaro Herrera <alvherre@alvh.no-ip.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox