pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix issues with wide tuples being updated and REPLICA IDENTITY F
Date: Sat, 05 Aug 2017 22:06:08 +0000
Message-ID: <E1de7Cy-0007M9-QO@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Fix issues with wide tuples being updated and REPLICA IDENTITY FULL.

When replica identity full is being used with a wide tuple (above 2^16
bytes after compression) it lead to errors and/or crashes during
decoding because the length field used to store such tuples doesn't
fit into the variable used to store the width in the WAL record.

To fix, discontinue use of xl_heap_header_len.t_len when decoding the
old tuple version, instead compute length of the old tuple by
subtracting the new tuple's length from the record length.

In newer version of postgres this issue is moot because the length is
stored by the new WAL machinery, instead of a xl_heap_header_len
struct.  A separate commit will forward-patch the regression test.

Reported-By: "anderson"
Discussion: http://postgr.es/m/20170105144819.f6i5o64vfvy4bn5i@alap3.anarazel.de

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/23a2b818f50ff9e1beb73c31cd902a2140476c30

Modified Files
--------------
contrib/test_decoding/expected/toast.out |  8 +++++++-
contrib/test_decoding/sql/toast.sql      |  3 ++-
src/backend/access/heap/heapam.c         |  8 +++++++-
src/backend/replication/logical/decode.c | 19 ++++++++++++++++---
4 files changed, 32 insertions(+), 6 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1de7Cy-0007M9-QO@gemulon.postgresql.org>
Permalink:  ../E1de7Cy-0007M9-QO@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1de7Cy-0007M9-QO@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de
  Subject: Re: pgsql: Fix issues with wide tuples being updated and REPLICA IDENTITY F
  In-Reply-To: <E1de7Cy-0007M9-QO@gemulon.postgresql.org>
  References: <E1de7Cy-0007M9-QO@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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