pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Jeremy Schneider <schnjere@amazon.com>
Cc: Drouvot, Bertrand <bdrouvot@amazon.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: logical decoding bug: segfault in ReorderBufferToastReplace()
Date: Fri, 13 Dec 2019 16:25:13 -0800
Message-ID: <20191214002513.p5rw6vqenzvrud5y@alap3.anarazel.de> (raw)
In-Reply-To: <81182626-e836-061f-8f19-204edac18922@amazon.com>
References: <E1i74JE-00024V-9J@gemulon.postgresql.org>
	<b1da9abc-bad7-efd6-2f1c-503d508c3877@amazon.com>
	<20191205133836.lulisfo2fphdrjp3@development>
	<EEB686D3-F8A7-4371-9A96-5DF3B72A7734@amazon.com>
	<20191211163522.t2ljtydarlmusoix@alap3.anarazel.de>
	<81182626-e836-061f-8f19-204edac18922@amazon.com>

Hi,

On 2019-12-13 16:13:35 -0800, Jeremy Schneider wrote:
> On 12/11/19 08:35, Andres Freund wrote:
> > I think we need to see pg_waldump output for the preceding records. That
> > might allow us to see why there's a toast record that's being associated
> > with this table, despite there not being a toast table.
> Unfortunately the WAL logs are no longer available at this time.  :(
> 
> I did a little poking around in the core file and searching source code
> but didn't find anything yet.  Is there any memory structure that would
> have the preceding/following records cached in memory?  If so then I
> might be able to extract this from the core dumps.

Well, not the records directly, but the changes could be, depending on
the size of the changes. That'd already help. It depends a bit on
whether there are subtransactions or not (txn->nsubtxns will tell
you). Within one transaction, the currently loaded (i.e. not changes
that are spilled to disk, and haven't currently been restored - see
txn->serialized) changes are in ReorderBufferTXN->changes.


> > Seems like we clearly should add an elog(ERROR) here, so we error out,
> > rather than crash.

> done - in the commit that I replied to when I started this thread :)
> 
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=69f883fef14a3fc5849126799278abcc4...

Ah, I was actually thinking this is the thread of a similar sounding
bug, where ReorderBufferToastReplace would crash because there isn't
actually a new tuple - there somehow toast changes exist for a delete.


> > Is this version of postgres effectively unmodified in any potentially
> > relevant region (snapshot computations, generation of WAL records, ...)?
> It's not changed from community code in any relevant regions.  (Also,
> FYI, this is not Aurora.)

Well, I've heard mutterings that plain RDS postgres had some efficiency
improvements around snapshots (in the GetSnapshotData() sense) - and
that's an area where slightly wrong changes could quite plausibly
cause a bug like this.

Greetings,

Andres Freund





view thread (21+ messages)  latest in thread

Message-ID: <20191214002513.p5rw6vqenzvrud5y@alap3.anarazel.de>
Permalink:  ../20191214002513.p5rw6vqenzvrud5y@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20191214002513.p5rw6vqenzvrud5y@alap3.anarazel.de

 · 

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, schnjere@amazon.com, bdrouvot@amazon.com, tomas.vondra@2ndquadrant.com, pgsql-bugs@postgresql.org, pgsql-hackers@postgresql.org
  Subject: Re: logical decoding bug: segfault in ReorderBufferToastReplace()
  In-Reply-To: <20191214002513.p5rw6vqenzvrud5y@alap3.anarazel.de>
  References: <E1i74JE-00024V-9J@gemulon.postgresql.org> <b1da9abc-bad7-efd6-2f1c-503d508c3877@amazon.com> <20191205133836.lulisfo2fphdrjp3@development> <EEB686D3-F8A7-4371-9A96-5DF3B72A7734@amazon.com> <20191211163522.t2ljtydarlmusoix@alap3.anarazel.de> <81182626-e836-061f-8f19-204edac18922@amazon.com> <20191214002513.p5rw6vqenzvrud5y@alap3.anarazel.de>

* 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