Re: Segfault logical replication PG 10.4 - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Segfault logical replication PG 10.4
Date
Msg-id 20180720190830.rcf3gp6g5hkdbbmn@alvherre.pgsql
Whole thread Raw
In response to Re: Segfault logical replication PG 10.4  (Quan TRAN <qtran@itscaro.me>)
Responses Re: Segfault logical replication PG 10.4  (Minh-Quan Tran <account@itscaro.me>)
List pgsql-hackers
On 2018-Jul-19, Quan TRAN wrote:

> Hello,
> 
> In worker.c:
> 
>     - in apply_handle_insert, slot_store_cstrings is called before
> PushActiveSnapshot
>     - in apply_handle_update & apply_handle_delete, slot_store_cstrings is
> called after PushActiveSnapshot
> 
>         /* Process and store remote tuple in the slot */
>         oldctx = MemoryContextSwitchTo(GetPerTupleMemoryContext(estate));
>         slot_store_cstrings(remoteslot, rel, newtup.values);
>         slot_fill_defaults(rel, estate, remoteslot);
>         MemoryContextSwitchTo(oldctx);
> 
>         PushActiveSnapshot(GetTransactionSnapshot());
> 
> Should this be the cause?

Yeah, moving the PushActiveSnapshot call to just before
slot_store_cstrings sounds right.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Nico Williams
Date:
Subject: Re: Add constraint in a Materialized View
Next
From: Mithun Cy
Date:
Subject: Re: Possible performance regression in version 10.1 with pgbenchread-write tests.