Re: BUG #15293: Stored Procedure Triggered by Logical Replication is Unable to use Notification Events
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Sergei Kornilov <sk@zsrv.org>, pgsql-hackers@postgresql.org,
Peter Eisentraut <peter_e@gmx.net>,
Marc Dean <marc.dean.jr@gmail.com>,
Petr Jelinek <petr@2ndquadrant.com>,
"michael.paul.powers@gmail.com" <michael.paul.powers@gmail.com>,
"pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2018-07-24T21:43:30Z
Lists: pgsql-bugs, pgsql-hackers
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
Commits
-
Disallow LISTEN in background workers.
- e06cc024bd33 13.5 landed
- d84d62b6225b 14.0 landed
- 1316be28664f 15.0 landed
-
Send NOTIFY signals during CommitTransaction.
- 63f28776cb9f 13.5 landed
- 2e4eae87d02f 15.0 landed
- 0eff10a00844 14.0 landed
-
Make some efficiency improvements in LISTEN/NOTIFY.
- 51004c7172b5 13.0 cited