pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: infernorb@gmail.com, pgsql-bugs@lists.postgresql.org, PG Bug reporting form <noreply@postgresql.org>
Subject: Re: BUG #15677: Crash while deleting from partitioned table
Date: Mon, 11 Mar 2019 12:55:05 +0900
Message-ID: <fb946563-ebf1-6bdb-1180-2c392ef31312@lab.ntt.co.jp> (raw)
In-Reply-To: <3ad5ba71-d200-96da-f903-7e3b16416140@lab.ntt.co.jp>
References: <15677-0bf089579b4cd02d@postgresql.org>
	<3ad5ba71-d200-96da-f903-7e3b16416140@lab.ntt.co.jp>

On 2019/03/11 12:02, Amit Langote wrote:
> From the above, I could conclude that EvalPlanQualStart() is not copying
> the value of es_root_result_relations from the parent EState.  That means
> ExecInitModifyTable called in the context of EvalPlanQual() checking has
> the wrong value of es_root_result_relations to begin with, so the value it
> computes for rootResultRelInfo for the ModifyTableState it's initializing
> is wrong (0xc0 as seen above).
> 
> To reproduce, use these steps (needs 2 sessions to invoke EvalPlanQual at
> all):
> 
> Setup:
> 
> create table p (a int) partition by list (a);
> create table p1 partition of p for values in (1);
> insert into p values (1);
> 
> Session 1:
> 
> begin;
> update p set a = a;
> 
> Session 2:
> 
> with u as (update p set a = a returning p.*) update p set a = u.a from u;
> <blocks>
> 
> Session 1:
> commit;
> 
> Session 2:
> <invokes-EvalPlanQual-and-crashes>
> server closed the connection unexpectedly
> 	This probably means the server terminated abnormally
> 	before or while processing the request.
> The connection to the server was lost. Attempting reset: Failed.
> 
> 
> This can be fixed by the attached patch, which modifies EvalPlanQualStart
> to copy the value of es_root_result_relations from its parent EState.

Forgot to mention that this bug exists in PG 10, 11, and HEAD.  The same
patch applies to all three branches.

Thanks,
Amit





view thread (8+ messages)  latest in thread

Message-ID: <fb946563-ebf1-6bdb-1180-2c392ef31312@lab.ntt.co.jp>
Permalink:  ../fb946563-ebf1-6bdb-1180-2c392ef31312@lab.ntt.co.jp/
Also on:    postgresql.org/message-id/fb946563-ebf1-6bdb-1180-2c392ef31312@lab.ntt.co.jp

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: Langote_Amit_f8@lab.ntt.co.jp, noreply@postgresql.org
  Subject: Re: BUG #15677: Crash while deleting from partitioned table
  In-Reply-To: <fb946563-ebf1-6bdb-1180-2c392ef31312@lab.ntt.co.jp>

* 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