pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Colin Morelli <colin.morelli@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Critical errors during logical decoding
Date: Thu, 8 Feb 2018 02:28:47 +0100
Message-ID: <2c1ca865-5e05-c22d-0766-72737a46e6a3@2ndquadrant.com> (raw)
In-Reply-To: <CAPtU-Urs_=Y14wN7bgF2gyShp5vT=rTvRCCP9LyMQbkmTv7WOA@mail.gmail.com>
References: <CAPtU-Uqf4AR1uQ_UCo15JB6QRBecEnm2EvByWMcKyJRnJCL00Q@mail.gmail.com>
	<CAPtU-UrxnUDWt=3aY6KDs+dGg9shZrq=bGsNXD6=D=a7gke=cA@mail.gmail.com>
	<b629384c-c53c-bb64-1dac-a27869c5ffde@2ndquadrant.com>
	<CAPtU-Urs_=Y14wN7bgF2gyShp5vT=rTvRCCP9LyMQbkmTv7WOA@mail.gmail.com>



On 02/07/2018 10:22 PM, Colin Morelli wrote:
> Hey Tomas,
> 
> We're using v1.1.0 of pglogical. I can't honestly say what could
> reproduce this issue as I'm not entirely sure and haven't tested it yet.
> 

Well, consider updating - there's 1.1.2 in that exact branch, and
there's also 2.1.1 now. I don't recall if there were bugs with such
symptoms, though.

> I had thought it was caused when a toasted row is deleted before the
> pglogical_output plugin processes the event (so it fails when going to
> de-toast the row), but I would imagine that postgres internally should
> prevent deleting data that would be needed by a replication stream. I
> must admit I'm not well versed in this area, though. My understanding is
> wal2json doesn't detoast the data at all, and thus doesn't have an issue
> (for our case, we really just need the json data with an identifier
> telling us that the row changed, we're not doing full logical replication).
> 

That seems really unlikely, for a couple of reasons.

1) As you've correctly guessed, toasted values are protected by the same
MVCC mechanism as regular tables, so rows should not disappear when
transactions might still need them (including replication).

2) The detoasting happens in reorderbuffer, which is shared both by
pglogical and wal2json. So both should have been affected.

3) You've also mentioned missing files in base/ which suggests there's
something far more serious going on. Not sure what, though.

I suggest you do one or both of these things:

a) update to newer pglogical version and see if it fixes the issue

b) try preparing a self-contained reproducer

c) share a more complete version of the server logs (hard to say what's
the issue from just a few lines)


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (5+ messages)

Message-ID: <2c1ca865-5e05-c22d-0766-72737a46e6a3@2ndquadrant.com>
Permalink:  ../2c1ca865-5e05-c22d-0766-72737a46e6a3@2ndquadrant.com/
Also on:    postgresql.org/message-id/2c1ca865-5e05-c22d-0766-72737a46e6a3@2ndquadrant.com

 · 

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-general@postgresql.org
  Cc: tomas.vondra@2ndquadrant.com, colin.morelli@gmail.com
  Subject: Re: Critical errors during logical decoding
  In-Reply-To: <2c1ca865-5e05-c22d-0766-72737a46e6a3@2ndquadrant.com>
  References: <CAPtU-Uqf4AR1uQ_UCo15JB6QRBecEnm2EvByWMcKyJRnJCL00Q@mail.gmail.com> <CAPtU-UrxnUDWt=3aY6KDs+dGg9shZrq=bGsNXD6=D=a7gke=cA@mail.gmail.com> <b629384c-c53c-bb64-1dac-a27869c5ffde@2ndquadrant.com> <CAPtU-Urs_=Y14wN7bgF2gyShp5vT=rTvRCCP9LyMQbkmTv7WOA@mail.gmail.com> <2c1ca865-5e05-c22d-0766-72737a46e6a3@2ndquadrant.com>

* 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