pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Sergei Kornilov <sk@zsrv.org>
Cc: pgsql-hackers@postgresql.org, Peter Eisentraut <peter_e@gmx.net>
Cc: Marc Dean <marc.dean.jr@gmail.com>
Cc: Petr Jelinek <petr@2ndquadrant.com>
Cc: michael.paul.powers@gmail.com <michael.paul.powers@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #15293: Stored Procedure Triggered by Logical Replication is Unable to use Notification Events
Date: Tue, 24 Jul 2018 17:43:30 -0400
Message-ID: <13844.1532468610@sss.pgh.pa.us> (raw)
In-Reply-To: <20180724192740.6yn2xregaz6yhpc2@alap3.anarazel.de>
References: <153243441449.1404.2274116228506175596@wrigleys.postgresql.org>
	<45136061532438385@iva3-a2a8aac410a1.qloud-c.yandex.net>
	<20180724155829.zq22vov6d7erhxsx@alap3.anarazel.de>
	<CAEU75wAdO7_t6MzSqWxua4Cca+KKpuHYYz6txz=VgETX--yYvw@mail.gmail.com>
	<648481532456538@myt5-0fa3e541b8b9.qloud-c.yandex.net>
	<20180724192740.6yn2xregaz6yhpc2@alap3.anarazel.de>

Andres Freund <andres@anarazel.de> writes:
> But I wonder if we shouldn't actually move the signalling part of
> ProcessCompletedNotifies() into CommitTransactionCommand() in v11. Given
> that transactions can now commit without a ready command being sent, due
> to the addition of procedures, that kind of seems necessary?

Hrm.  I have a nasty feeling that that code is dependent on being executed
at the outermost logic level.  In particular, ProcessCompletedNotifies
calls CommitTransactionCommand itself, so your proposal will create
infinite recursion.  There may be some other issues too.

Another question that needs consideration is whether an internal commit
should lead to immediate distribution of notifies to our own client.
I think it probably mustn't; from the standpoint of the client, its
originally-asked-for xact is still in progress, and it's not going to
expect any notifies until that ends.  So the proposed change is just
wrong if you ask me.

I agree we need some serious rethinking here.  Maybe the fix will end
up being just a few lines, but it might take significant restructuring
too.

			regards, tom lane




view thread (25+ messages)  latest in thread

Message-ID: <13844.1532468610@sss.pgh.pa.us>
Permalink:  ../13844.1532468610@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13844.1532468610@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, andres@anarazel.de, sk@zsrv.org, peter_e@gmx.net, marc.dean.jr@gmail.com, petr@2ndquadrant.com, michael.paul.powers@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #15293: Stored Procedure Triggered by Logical Replication is Unable to use Notification Events
  In-Reply-To: <13844.1532468610@sss.pgh.pa.us>

* 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