Re: Foreign join pushdown vs EvalPlanQual

From: Jeevan Chalke <jeevan(dot)chalke(at)enterprisedb(dot)com>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, 花田茂 <shigeru(dot)hanada(at)gmail(dot)com>
Subject: Re: Foreign join pushdown vs EvalPlanQual
Date: 2015-10-09 12:48:52
Message-ID: CAM2+6=XsXhMw_owFiKJP9syUx9eFc0x5U9jGOtO9v34G5epd8g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 9, 2015 at 3:35 PM, Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
wrote:

Hi,

Just to have hands on, I started looking into this issue and trying to
grasp it as this is totally new code for me. And later I want to review
this code changes.

I have noticed that, this thread started saying we are getting a crash
with the given steps with foreign_join_v16.patch, I am correct?

Then there are various patches which trying to fix this,
fdw-eval-plan-qual-*.patch

I have tried applying foreign_join_v16.patch, which was good. And tried
reproducing the crash. But instead of crash I am getting following error.

ERROR: could not serialize access due to concurrent update
CONTEXT: Remote SQL command: SELECT a FROM public.foo FOR UPDATE
Remote SQL command: SELECT a FROM public.tab FOR UPDATE

Then I have applied fdw-eval-plan-qual-3.0.patch on top of it. It was not
getting applied cleanly (may be due to some other changes meanwhile).
I fixed the conflicts and the warnings to make it compile.

When I run same sql sequence, I am getting crash in terminal 2 at EXPLAIN
it self.

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.
!>

Following sql statement I am using:

create table tab (a int, b int);
create foreign table foo (a int) server myserver options(table_name 'tab');
create foreign table bar (a int) server myserver options(table_name 'tab');

insert into tab values (1, 1);
insert into foo values (1);
insert into bar values (1);

analyze tab;
analyze foo;
analyze bar;

Run the example:

[Terminal 1]
begin;
update tab set b = b + 1 where a = 1;

[Terminal 2]
explain verbose select tab.* from tab, foo, bar where tab.a =
foo.a and foo.a = bar.a for update;

Am I missing something here?
Do I need to apply any other patch from other mail-threads?

Do you have sample test-case explaining the issue and fix?

With these simple questions, I might have taking the thread slightly off
from the design considerations, please excuse me for that.

Thanks

--
Jeevan B Chalke
Principal Software Engineer, Product Development
EnterpriseDB Corporation
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2015-10-09 13:22:01 Re: proposal: PL/Pythonu - function ereport
Previous Message Joe Conway 2015-10-09 12:10:11 Re: Multi-tenancy with RLS