pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix assertion during streaming of multi-insert toast changes.
Date: Thu, 27 May 2021 02:39:34 +0000
Message-ID: <E1lm5vq-0006lc-F6@gemulon.postgresql.org> (raw)

Fix assertion during streaming of multi-insert toast changes.

While decoding the multi-insert WAL we can't clean the toast untill we get
the last insert of that WAL record. Now if we stream the changes before we
get the last change, the memory for toast chunks won't be released and we
expect the txn to have streamed all changes after streaming.  This
restriction is mainly to ensure the correctness of streamed transactions
and it doesn't seem worth uplifting such a restriction just to allow this
case because anyway we will stream the transaction once such an insert is
complete.

Previously we were using two different flags (one for toast tuples and
another for speculative inserts) to indicate partial changes. Now instead
we replaced both of them with a single flag to indicate partial changes.

Reported-by: Pavan Deolasee
Author: Dilip Kumar
Reviewed-by: Pavan Deolasee, Amit Kapila
Discussion: https://postgr.es/m/CABOikdN-_858zojYN-2tNcHiVTw-nhxPwoQS4quExeweQfG1Ug@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6f4bdf81529fdaf6744875b0be99ecb9bfb3b7e0

Modified Files
--------------
contrib/test_decoding/expected/stream.out       | 24 +++++++++++++
contrib/test_decoding/sql/stream.sql            | 18 ++++++++++
src/backend/replication/logical/reorderbuffer.c | 46 ++++++++++++++-----------
src/include/replication/reorderbuffer.h         | 27 ++++-----------
4 files changed, 73 insertions(+), 42 deletions(-)



Message-ID: <E1lm5vq-0006lc-F6@gemulon.postgresql.org>
Permalink:  ../E1lm5vq-0006lc-F6@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lm5vq-0006lc-F6@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: akapila@postgresql.org
  Subject: Re: pgsql: Fix assertion during streaming of multi-insert toast changes.
  In-Reply-To: <E1lm5vq-0006lc-F6@gemulon.postgresql.org>
  References: <E1lm5vq-0006lc-F6@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