Re: Multi-insert into a partitioned table with before insert row trigger causes server crash on latest HEAD

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Multi-insert into a partitioned table with before insert row trigger causes server crash on latest HEAD
Date: 2018-10-20 21:15:31
Message-ID: CAKJS1f9zK+dsgQH54XpwZbUc-NJvZ9fXSQEtTvvK04Y5gNNmPA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 21 October 2018 at 04:03, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com> wrote:
>> Thanks for pushing that fix.
>>
>> Originally my patch in [1] only could set leafpart_use_multi_insert to
>> true within the `if (insertMethod == CIM_MULTI_CONDITIONAL)` test, so
>> wouldn't have suffered from this problem.
>>
>
> The problem is reproducible even with the patch in [1] combined with
> the v6 edition of delta patch. Actually this problem has nothing to do
> with where we set leafpart_use_multi_insert flag. It's about using the
> right values (updated values) to decide if the current partition is
> good to go for multi-insert or not. Like i mentioned earlier reply,
> we actually came across this problem because we have used outdated
> value for before insert row trigger to evaluate
> leafpart_use_multi_insert flag.
>
> [1] https://www.postgresql.org/message-id/CAKJS1f9f8yuj04X_rffNu2JPbvhy+YP_aVH6iwCTJ1OL=YwCOg@mail.gmail.com

Oops. I was completely wrong about all of what I said above. Seems my
analysis was rushed and very incorrect.

Thanks for writing the patch Ashutosh and thanks Peter for committing
the modified version of it.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Johannes Graën 2018-10-21 09:27:20 found xmin x from before relfrozenxid y
Previous Message Tom Lane 2018-10-20 16:37:28 Re: gemulon migration upcoming