pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedMonitor repl slot size
3+ messages / 3 participants
[nested] [flat]
* Monitor repl slot size
@ 2018-07-13 10:19 Nicola Contu <nicola.contu@gmail.com>
2018-07-13 10:43 ` Re: Monitor repl slot size Achilleas Mantzios <achill@matrix.gatewaynet.com>
2018-07-13 14:30 ` RE: Monitor repl slot size Igor Neyman <ineyman@perceptron.com>
0 siblings, 2 replies; 3+ messages in thread
From: Nicola Contu @ 2018-07-13 10:19 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org; +Cc: Alessandro Aste <Alessandro.aste@gtt.net>
Hello,
we used to monitor the replication slot size on postgres 9.6.6 with the
following query:
SELECT pg_xlog_location_diff(pg_current_xlog_location(), restart_lsn) FROM
pg_replication_slots WHERE slot_name = 'SLOT NAME';
We are moving to postgres 10.4 and we saw the pg_xlog_location_diff is not
there anymore.
I know we can re-create it following this link :
https://github.com/DataDog/integrations-core/issues/907
but, is there any better way to do it? Any replacement for that function on
postgres 10?
Thanks a lot,
Nicola
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Monitor repl slot size
2018-07-13 10:19 Monitor repl slot size Nicola Contu <nicola.contu@gmail.com>
@ 2018-07-13 10:43 ` Achilleas Mantzios <achill@matrix.gatewaynet.com>
1 sibling, 0 replies; 3+ messages in thread
From: Achilleas Mantzios @ 2018-07-13 10:43 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On 13/07/2018 13:19, Nicola Contu wrote:
> Hello,
> we used to monitor the replication slot size on postgres 9.6.6 with the following query:
>
> SELECT pg_xlog_location_diff(pg_current_xlog_location(), restart_lsn) FROM pg_replication_slots WHERE slot_name = 'SLOT NAME';
>
> We are moving to postgres 10.4 and we saw the pg_xlog_location_diff is not there anymore.
>
location -> lsn
xlog -> wal
SELECT pg_wal_lsn_diff(pg_current_wal_insert_lsn(), restart_lsn) FROM pg_replication_slots;
> I know we can re-create it following this link : https://github.com/DataDog/integrations-core/issues/907
>
> but, is there any better way to do it? Any replacement for that function on postgres 10?
>
> Thanks a lot,
> Nicola
--
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt
^ permalink raw reply [nested|flat] 3+ messages in thread
* RE: Monitor repl slot size
2018-07-13 10:19 Monitor repl slot size Nicola Contu <nicola.contu@gmail.com>
@ 2018-07-13 14:30 ` Igor Neyman <ineyman@perceptron.com>
1 sibling, 0 replies; 3+ messages in thread
From: Igor Neyman @ 2018-07-13 14:30 UTC (permalink / raw)
To: Nicola Contu <nicola.contu@gmail.com>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>; +Cc: Alessandro Aste <Alessandro.aste@gtt.net>
From: Nicola Contu [mailto:nicola.contu@gmail.com]
Sent: Friday, July 13, 2018 6:19 AM
To: pgsql-general@lists.postgresql.org
Cc: Alessandro Aste <Alessandro.aste@gtt.net>
Subject: Monitor repl slot size
Hello,
we used to monitor the replication slot size on postgres 9.6.6 with the following query:
SELECT pg_xlog_location_diff(pg_current_xlog_location(), restart_lsn) FROM pg_replication_slots WHERE slot_name = 'SLOT NAME';
We are moving to postgres 10.4 and we saw the pg_xlog_location_diff is not there anymore.
I know we can re-create it following this link : https://github.com/DataDog/integrations-core/issues/907
but, is there any better way to do it? Any replacement for that function on postgres 10?
Thanks a lot,
Nicola
I’m compare current_wal_lsn to confirmed_flush_lsn:
SELECT confirmed_flush_lsn, pg_current_wal_lsn(), (pg_current_wal_lsn() - confirmed_flush_lsn) AS lsn_distance -- returned as NUMERIC
FROM pg_catalog.pg_replication_slots
WHERE slot_name = 'Slot NAME';
Regards,
Igor Neyman
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2018-07-13 14:30 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-07-13 10:19 Monitor repl slot size Nicola Contu <nicola.contu@gmail.com>
2018-07-13 10:43 ` Achilleas Mantzios <achill@matrix.gatewaynet.com>
2018-07-13 14:30 ` Igor Neyman <ineyman@perceptron.com>
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