RE: BUG #16481: Stored Procedure Triggered by Logical Replication isUnable to use Notification Events

Поиск
Список
Период
Сортировка
От Vianello Fabio
Тема RE: BUG #16481: Stored Procedure Triggered by Logical Replication isUnable to use Notification Events
Дата
Msg-id AM6PR06MB61686DD1D371FB4F20BADAE493850@AM6PR06MB6168.eurprd06.prod.outlook.com
обсуждение исходный текст
Ответ на Re: BUG #16481: Stored Procedure Triggered by Logical Replicationis Unable to use Notification Events  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Ответы RE: BUG #16481: Stored Procedure Triggered by Logical Replication isUnable to use Notification Events  (Vianello Fabio <fabio.vianello@salvagninigroup.com>)
RE: BUG #16481: Stored Procedure Triggered by Logical Replication isUnable to use Notification Events  (Vianello Fabio <fabio.vianello@salvagninigroup.com>)
Список pgsql-bugs
Hi Kyotaro Horiguchi, thanks for you helps.
We have a question about the bug. Why there isn't any solution in the HEAD?

This bug last since 10.4 version and I can't understand why it is not fixed in the HEAD  yet.

BR.
Fabio Vianello.


-----Original Message-----
From: Kyotaro Horiguchi [mailto:horikyota.ntt@gmail.com]
Sent: lunedì 8 giugno 2020 10:28
To: Vianello Fabio <fabio.vianello@salvagninigroup.com>; pgsql-bugs@lists.postgresql.org;
pgsql-hackers@lists.postgresql.org
Subject: Re: BUG #16481: Stored Procedure Triggered by Logical Replication is Unable to use Notification Events

Hello.

It seems to me a bug.

At Fri, 05 Jun 2020 11:05:14 +0000, PG Bug reporting form <noreply@postgresql.org> wrote in
> The following bug has been logged on the website:
>
> Bug reference:      16481
> Logged by:          Fabio Vianello
> Email address:      fabio.vianello@salvagninigroup.com
> PostgreSQL version: 12.3
> Operating system:   Windows 10
> Description:
>
> About the bug BUG #15293, on PostgreSQL version 10.4 and 11.2 as
> describe below, we found the same issue on the PostgreSQL version 12.3.

The HEAD behaves the same way.

> Is it a feature?
> Becasue in the documentation we didn't found any constraint that says
> that we can not use NOTIFY/LISTEN on logical replication tables.
>
> "When using logical replication a stored procedure executed on the
> replica is unable to use NOTIFY to send messages to other listeners.
> The stored procedure does execute as expected but the pg_notify()
> doesn't appear to have any effect. If an insert is run on the replica
> side the trigger executes the stored procedure as expected and the
> NOTIFY correctly notifies listeners.

The message is actually queued, but logical replication worker doesn't signal that to listener backends. If any
ordinarysession sent a message to the same listener after that, both messages would be shown at once.
 

That can be fixed by calling ProcessCompletedNotifies() in apply_handle_commit. The function has a code to write out
notificationsto connected clients but it doesn't nothing on logical replication workers.
 

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center
SALVAGNINI ITALIA S.p.A.
Via Guido Salvagnini, 51 - IT - 36040 Sarego (VI)
T. +39 0444 725111 | F. +39 0444 43 6404
Società a socio unico - Attività direz. e coord.: Salvagnini Holding S.p.A.
Clicca qui<https://www.salvagninigroup.com/company-information> per le informazioni societarie
salvagninigroup.com<https://www.salvagninigroup.com> | salvagnini.it<http://www.salvagnini.it>


Le informazioni trasmesse sono destinate esclusivamente alla persona o alla società in indirizzo e sono da intendersi
confidenzialie riservate. Ogni trasmissione, inoltro, diffusione o altro uso di queste informazioni a persone o società
differentidal destinatario è proibita. Se avete ricevuto questa comunicazione per errore, per favore contattate il
mittentee cancellate le informazioni da ogni computer. Questa casella di posta elettronica è riservata esclusivamente
all’invioed alla ricezione di messaggi aziendali inerenti all’attività lavorativa e non è previsto né autorizzato
l’utilizzoper fini personali. Pertanto i messaggi in uscita e quelli di risposta in entrata verranno trattati quali
messaggiaziendali e soggetti alla ordinaria gestione disposta con proprio disciplinare dall’azienda e, di conseguenza,
eventualmenteanche alla lettura da parte di persone diverse dall’intestatario della casella.
 

Any information herein transmitted only concerns the person or the company named in the address and is deemed to be
confidential.It is strictly forbidden to transmit, post, forward or otherwise use said information to anyone other than
therecipient. If you have received this message by mistake, please contact the sender and delete any relevant
informationfrom your computer. This mailbox is only meant for sending and receiving messages pertaining business
mattersand any other use for personal purposes is forbidden and unauthorized. Therefore, any email sent and received
willbe handled as ordinary business messages and subject to the company's own rules, and may thus be read also by
peopleother than the user named in the mailbox address.
 

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: BUG #16484: pg_regress fails with --outputdir parameter
Следующее
От: Euler Taveira
Дата:
Сообщение: Re: BUG #16481: Stored Procedure Triggered by Logical Replication isUnable to use Notification Events