Re: [GENERAL] NOTIFY command impact

2017-02-23 Thread Benoit Lobréau
Hi ! Indeed :) Thanks for taking the time to explain ! Benoit.

Re: [GENERAL] NOTIFY command impact

2017-02-23 Thread Rob Brucks
, February 23, 2017 at 9:23 AM To: "David G. Johnston" Cc: Rob Brucks , Tom Lane , François Beaulieu , Adrian Klaver , "pgsql-general@postgresql.org" Subject: Re: [GENERAL] NOTIFY command impact Hi, I might have missed something. This should be enough to solve the problem no

Re: [GENERAL] NOTIFY command impact

2017-02-23 Thread Benoit Lobréau
Hi, I might have missed something. This should be enough to solve the problem no ? SELECT CASE WHEN pg_last_xlog_receive_location() = pg_last_xlog_replay_location() THEN 0 ELSE EXTRACT (EPOCH FROM now() - pg_last_xact_replay_timestamp())::INTEGER END AS replication_lag; Benoit.

Re: [GENERAL] NOTIFY command impact

2017-02-22 Thread David G. Johnston
On Wed, Feb 22, 2017 at 3:05 PM, Rob Brucks wrote: > So, long-term, you don't see any negative impacts to the master cluster? > > I just don't want to implement this as a streaming "push" mechanism and > then have my cluster crash in 12 months because it hit some obscure problem > with notificati

Re: [GENERAL] NOTIFY command impact

2017-02-22 Thread Rob Brucks
Thank you Tom. So, long-term, you don't see any negative impacts to the master cluster? I just don't want to implement this as a streaming "push" mechanism and then have my cluster crash in 12 months because it hit some obscure problem with notifications. This turned out to be a really simple/

Re: [GENERAL] NOTIFY command impact

2017-02-22 Thread Tom Lane
=?utf-8?Q?Fran=C3=A7ois_Beaulieu?= writes: >> On Feb 21, 2017, at 6:03 PM, Tom Lane wrote: >> (The reason it goes into the WAL stream is so that you can have listeners >> on replication slaves, not for recovery purposes.) > Are we sure that replication slaves can have listeners? When I tried it

Re: [GENERAL] NOTIFY command impact

2017-02-22 Thread François Beaulieu
> On Feb 21, 2017, at 6:03 PM, Tom Lane wrote: > > Rob Brucks writes: >> If a notify is sent and then PG is immediately shut down, wouldn't PG want >> to save that message for processing after startup? >> Or is the message just discarded? > > NOTIFY data is not saved across a shutdown or cras

Re: [GENERAL] NOTIFY command impact

2017-02-22 Thread Rob Brucks
Thanks Tom, Can you answer my original question too: If I am issuing NOTIFY commands every 30 seconds (and immediately committing) and there are no listeners, will that have a negative impact on the cluster? I'm using the NOTIFY to force streaming replication to update the "pg_last_xact_replay

Re: [GENERAL] NOTIFY command impact

2017-02-21 Thread François Beaulieu
> On Feb 21, 2017, at 6:03 PM, Tom Lane wrote: > > Rob Brucks writes: >> If a notify is sent and then PG is immediately shut down, wouldn't PG want >> to save that message for processing after startup? >> Or is the message just discarded? > > NOTIFY data is not saved across a shutdown or cras

Re: [GENERAL] NOTIFY command impact

2017-02-21 Thread David G. Johnston
On Tue, Feb 21, 2017 at 3:47 PM, Rob Brucks wrote: > If a notify is sent and then PG is immediately shut down, wouldn't PG want > to save that message for processing after startup? > > > > Or is the message just discarded? > > > ​Adrian gave details but trying to figure out notification semantic

Re: [GENERAL] NOTIFY command impact

2017-02-21 Thread Tom Lane
Rob Brucks writes: > If a notify is sent and then PG is immediately shut down, wouldn't PG want to > save that message for processing after startup? > Or is the message just discarded? NOTIFY data is not saved across a shutdown or crash. (The reason it goes into the WAL stream is so that you ca

Re: [GENERAL] NOTIFY command impact

2017-02-21 Thread Adrian Klaver
itor the size of : $PG_DATA/pg_notify/ > > > > --Rob > > > > *From: *"David G. Johnston" > *Date: *Tuesday, February 21, 2017 at 3:38 PM > *To: *Adrian Klaver > *Cc: *Rob Brucks , > "pgsql-general@

Re: [GENERAL] NOTIFY command impact

2017-02-21 Thread Rob Brucks
"pgsql-general@postgresql.org" Subject: Re: [GENERAL] NOTIFY command impact On Tue, Feb 21, 2017 at 3:43 PM, Rob Brucks mailto:rob.bru...@rackspace.com>> wrote: But I wonder if that file is only used to store notify commands during shutdown/startup? ​ huh?​ David J.

Re: [GENERAL] NOTIFY command impact

2017-02-21 Thread David G. Johnston
On Tue, Feb 21, 2017 at 3:43 PM, Rob Brucks wrote: > But I wonder if that file is only used to store notify commands during > shutdown/startup? > ​ huh?​ David J.

Re: [GENERAL] NOTIFY command impact

2017-02-21 Thread Rob Brucks
*Adrian Klaver > *Cc: *Rob Brucks , > "pgsql-general@postgresql.org" > *Subject: *Re: [GENERAL] NOTIFY command impact > > > > On Tue, Feb 21, 2017 at 2:17 PM, Adrian Klaver > mailto:adrian.kla...@aklaver.com>> wrote:

Re: [GENERAL] NOTIFY command impact

2017-02-21 Thread Adrian Klaver
listen does not yet exist. Seems the thing to do would be to monitor the size of : $PG_DATA/pg_notify/ --Rob *From: *"David G. Johnston" *Date: *Tuesday, February 21, 2017 at 3:38 PM *To: *Adrian Klaver *Cc: *Rob Brucks , "pgsql-general@postgresql.org" *Subject: *

Re: [GENERAL] NOTIFY command impact

2017-02-21 Thread Rob Brucks
David G. Johnston" Date: Tuesday, February 21, 2017 at 3:38 PM To: Adrian Klaver Cc: Rob Brucks , "pgsql-general@postgresql.org" Subject: Re: [GENERAL] NOTIFY command impact On Tue, Feb 21, 2017 at 2:17 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 02/21

Re: [GENERAL] NOTIFY command impact

2017-02-21 Thread Rob Brucks
In my case the monitoring user will be connecting, issuing the notify, then immediately disconnecting. And we don't have any systems using listen/notify. So I'm hoping there won't be a problem. That's why I'm asking ☺ --Rob On 2/21/17, 3:17 PM, "Adrian Klaver" wrote: On 02/21/2017 01:07

Re: [GENERAL] NOTIFY command impact

2017-02-21 Thread David G. Johnston
On Tue, Feb 21, 2017 at 2:17 PM, Adrian Klaver wrote: > On 02/21/2017 01:07 PM, Rob Brucks wrote: > >> >> Do you see any long-term problems with constantly issuing "NOTIFY" >> commands every 30 seconds without an associated "LISTEN" command? >> > > Depending on how long 'long term' is: > > https:

Re: [GENERAL] NOTIFY command impact

2017-02-21 Thread Adrian Klaver
On 02/21/2017 01:07 PM, Rob Brucks wrote: Hi All, I just wanted to check with you guys to make sure that constantly issuing "NOTIFY" commands without corresponding "LISTEN" commands will not cause any harm or excessive work for the PostgreSQL cluster. Nothing that would put my cluster at risk.