pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Etsuro Fujita <etsuro.fujita@gmail.com>
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17344: Assert failed on queiring async_capable foreign table with inheritance
Date: Sun, 2 Jan 2022 22:00:00 +0300
Message-ID: <d10cbf5d-d45a-d3b4-51b3-0a80f5039ed3@gmail.com> (raw)
In-Reply-To: <CAPmGK16n1VHbJHTRdrJ3vS8ZEv2vkFsNT_mf00kKffS04uctMw@mail.gmail.com>
References: <17344-226b78b00de73a7e@postgresql.org>
	<20211225232625.5xuplnlegneh42cw@erthalion.local>
	<CAPmGK15F_oKapcDmrBeRD5bOiyTPhN+8UPPz6r0ANKwGei3hsQ@mail.gmail.com>
	<CAPmGK16n1VHbJHTRdrJ3vS8ZEv2vkFsNT_mf00kKffS04uctMw@mail.gmail.com>

Hello Etsuro-san,
31.12.2021 10:36, Etsuro Fujita wrote:
> On Tue, Dec 28, 2021 at 10:14 PM Etsuro Fujita <etsuro.fujita@gmail.com> wrote:
>> The root cause of the
>> assertion failure in the first case might be something other than the
>> limitation.  I’ll look into this in more detail.
> To fix, I modified postgresReScanForeignScan() so that we always
> process a pending async request (if any) before restarting the foreign
> scan.  Attached is a patch for that.  I tested the patch with the
> first case, and it addresses the assertion failure.
Thanks for the fix! I can confirm that it eliminates the failure and
propose a simple test case for the issue. Maybe you will find it useful.

Best regards,
Alexander

Attachments:

  [text/x-patch] posgres_fdw.sql.patch (967B, ../d10cbf5d-d45a-d3b4-51b3-0a80f5039ed3@gmail.com/2-posgres_fdw.sql.patch)
  download | inline diff:
diff --git a/contrib/postgres_fdw/sql/postgres_fdw.sql b/contrib/postgres_fdw/sql/postgres_fdw.sql
index ee9ab37d56..9cc13475f6 100644
--- a/contrib/postgres_fdw/sql/postgres_fdw.sql
+++ b/contrib/postgres_fdw/sql/postgres_fdw.sql
@@ -1935,6 +1935,15 @@ explain (verbose, costs off)
 select * from bar where f1 in (select f1 from foo) for share;
 select * from bar where f1 in (select f1 from foo) for share;
 
+-- Check asynchronous fetch with inheritance
+alter server loopback options (add async_capable 'true');
+create foreign table foo3 (f3 int)
+  server loopback options (table_name 'loct1');
+create foreign table bar3 () inherits(foo3)
+  server loopback options (table_name 'loct2');
+select f1 from foo where f1 in (select f1 from foo3);
+alter server loopback options (drop async_capable);
+
 -- Now check SELECT FOR UPDATE/SHARE with an inherited source table,
 -- where the parent is itself a foreign table
 create table loct4 (f1 int, f2 int, f3 int);

view thread (12+ messages)  latest in thread

Message-ID: <d10cbf5d-d45a-d3b4-51b3-0a80f5039ed3@gmail.com>
Permalink:  ../d10cbf5d-d45a-d3b4-51b3-0a80f5039ed3@gmail.com/
Also on:    postgresql.org/message-id/d10cbf5d-d45a-d3b4-51b3-0a80f5039ed3@gmail.com

 ·  · 

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: exclusion@gmail.com, etsuro.fujita@gmail.com, 9erthalion6@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17344: Assert failed on queiring async_capable foreign table with inheritance
  In-Reply-To: <d10cbf5d-d45a-d3b4-51b3-0a80f5039ed3@gmail.com>

* 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