Re: BUG #16129: Segfault in tts_virtual_materialize in logical replication worker

From: Ondřej Jirman <ienieghapheoghaiwida(at)xff(dot)cz>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16129: Segfault in tts_virtual_materialize in logical replication worker
Date: 2019-11-21 18:58:44
Message-ID: 20191121185844.6qsqhwzzuhu3fpsg@core.my.home
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Nov 21, 2019 at 06:35:55PM +0100, Ondřej Jirman wrote:
> One missing piece is what exactly is the contents of the outstanding output from
> pgoutput plugin, that the replica crashes on and doesn't apply. Are there any
> tools for inspecting the binary output from the pgoutput plugin? Maybe that can
> provide a clue.

So I've looked at it manually, and the segfaulting transaction doesn't make
much sense to me. On primary a row with 37880 byte cover_image was inserted,
but pgoutput plugin sends these records:

B
R - public.videos title cover_image metadata,...
U - new row where cover_image tuple doesn't have any data, just a flag ('u')
C

Which means 'unchanged toast column' according to logical/proto.c

Yet cover_image is defined as not null.

I guess it's some special handling for VARATT_IS_EXTERNAL_ONDISK.

To me this looks like this transaction is assuming data for bytea column
cover_image are already replicated from earlier?

Maybe it is not though? It's certainly breaking some assumption on the
replica, because this is the precise point where segfault happens.

regards,
o.

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2019-11-21 19:01:07 BUG #16131: pg_upgrade 9 -> 11.6 and a database is missing
Previous Message Tom Lane 2019-11-21 17:48:00 Re: BUG #16130: planner does not pick unique btree index and goes for seq scan but unsafe hash index works.