pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: 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>
Cc: Schneider (AWS), Jeremy <schnjere@amazon.com>
Subject: Re: logical decoding bug: segfault in ReorderBufferToastReplace()
Date: Wed, 11 Dec 2019 08:35:22 -0800
Message-ID: <20191211163522.t2ljtydarlmusoix@alap3.anarazel.de> (raw)
In-Reply-To: <EEB686D3-F8A7-4371-9A96-5DF3B72A7734@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>

Hi,

On 2019-12-11 08:17:01 +0000, Drouvot, Bertrand wrote:
>     >>Core was generated by `postgres: walsender <NAME-REDACTED>
>     >><DNS-REDACTED>(31712)'.
>     >>Program terminated with signal 11, Segmentation fault.
>     >>#0  ReorderBufferToastReplace (rb=0x3086af0, txn=0x3094a78,
>     >>relation=0x2b79177249c8, relation=0x2b79177249c8, change=0x30ac938)
>     >>    at reorderbuffer.c:3034
>     >>3034    reorderbuffer.c: No such file or directory.
>     >>...
>     >>(gdb) #0  ReorderBufferToastReplace (rb=0x3086af0, txn=0x3094a78,
>     >>relation=0x2b79177249c8, relation=0x2b79177249c8, change=0x30ac938)
>     >>    at reorderbuffer.c:3034
>     >>#1  ReorderBufferCommit (rb=0x3086af0, xid=xid@entry=1358809,
>     >>commit_lsn=9430473346032, end_lsn=<optimized out>,
>     >>    commit_time=commit_time@entry=628712466364268,
>     >>origin_id=origin_id@entry=0, origin_lsn=origin_lsn@entry=0) at
>     >>reorderbuffer.c:1584

This indicates that a toast record was present for that relation,
despite:

> 
> \d+ rel_having_issue
>                                                              Table "public.rel_having_issue"
>      Column     |           Type           | Collation | Nullable |                     Default                     | Storage  | Stats target | Description
> ----------------+--------------------------+-----------+----------+-------------------------------------------------+----------+--------------+-------------
>  id             | integer                  |           | not null | nextval('rel_having_issue_id_seq'::regclass) | plain    |              |
>  field1           | character varying(255)   |           |          |                                                 | extended |              |
>  field2          | integer                  |           |          |                                                 | plain    |              |
>  field3 | timestamp with time zone |           |          |                                                 | plain    |              |
> Indexes:
>     "rel_having_issue_pkey" PRIMARY KEY, btree (id)
> 
> select relname,relfilenode,reltoastrelid from pg_class where relname='rel_having_issue';
>        relname       | relfilenode | reltoastrelid
> ---------------------+-------------+---------------
>  rel_having_issue |       16428 |             0


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.

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

Has there been DDL to this table?

Could you print out *change?

Is this version of postgres effectively unmodified in any potentially
relevant region (snapshot computations, generation of WAL records, ...)?

Greetings,

Andres Freund





view thread (21+ messages)  latest in thread

Message-ID: <20191211163522.t2ljtydarlmusoix@alap3.anarazel.de>
Permalink:  ../20191211163522.t2ljtydarlmusoix@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20191211163522.t2ljtydarlmusoix@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, bdrouvot@amazon.com, tomas.vondra@2ndquadrant.com, pgsql-bugs@postgresql.org, pgsql-hackers@postgresql.org, schnjere@amazon.com
  Subject: Re: logical decoding bug: segfault in ReorderBufferToastReplace()
  In-Reply-To: <20191211163522.t2ljtydarlmusoix@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>

* 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