Re: BUG #17355: Server crashes on ExecReScanForeignScan in postgres_fdw when accessing foreign partition - Mailing list pgsql-bugs

From Etsuro Fujita
Subject Re: BUG #17355: Server crashes on ExecReScanForeignScan in postgres_fdw when accessing foreign partition
Date
Msg-id CAPmGK166WGTskmduTR+N7enYDUGrtvmVLZPn0ak_gk3gcYTaCQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #17355: Server crashes on ExecReScanForeignScan in postgres_fdw when accessing foreign partition  (Alexander Lakhin <exclusion@gmail.com>)
Responses Re: BUG #17355: Server crashes on ExecReScanForeignScan in postgres_fdw when accessing foreign partition  (Alexander Lakhin <exclusion@gmail.com>)
Re: BUG #17355: Server crashes on ExecReScanForeignScan in postgres_fdw when accessing foreign partition  (Amit Langote <amitlangote09@gmail.com>)
Re: BUG #17355: Server crashes on ExecReScanForeignScan in postgres_fdw when accessing foreign partition  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-bugs
Hi Alexander,

On Tue, Feb 1, 2022 at 1:00 PM Alexander Lakhin <exclusion@gmail.com> wrote:
> 30.01.2022 13:59, Etsuro Fujita wrote:
> >> (Besides that I've observed an infinite waiting for ShareLock with
> >> step "s1i" { INSERT INTO pt VALUES (2000); }
> >> This doesn't happen with a regular (not foreign) table.)
> > You mean the lock wait occurs on the remote side, not on the local
> > side?  If so, I think that that is expected behavior because a write
> > conflict occurs on the remote side in that case.  Maybe I don’t fully
> > understand your words, so could you elaborate a bit more on your
> > observation?
> Yes, you are right, that was expected behavior. I didn't realize that
> the isolationtester itself resolves blocking when the target table is local.
> The isolationtester controls the step execution using
> pg_isolation_test_session_is_blocked(), but when the target table is
> foreign, it can not determine correctly whether one step blocking other
> (cause it checks local, not remote session pids) and just hangs.

Ok, thanks for the explanation!

Attached is an updated patch.  I tweaked a comment a little bit and
added the commit message.  I didn’t include your test because in my
understanding we don’t add such a test into the postgres_fdw
regression test.  I’ll commit the patch if there are no objections
from you (or anyone else).

Best regards,
Etsuro Fujita

Attachment

pgsql-bugs by date:

Previous
From: Nick Cleaton
Date:
Subject: Re: BUG #17389: pg_repack creates race conditions on streaming replicas
Next
From: Ben Chobot
Date:
Subject: Re: BUG #17389: pg_repack creates race conditions on streaming replicas