Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fdvYf-0008Fs-9L for pgsql-general@arkaria.postgresql.org; Fri, 13 Jul 2018 10:44:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fdvYd-00053A-1O for pgsql-general@arkaria.postgresql.org; Fri, 13 Jul 2018 10:44:15 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fdvYc-000532-Hw for pgsql-general@lists.postgresql.org; Fri, 13 Jul 2018 10:44:14 +0000 Received: from hermes.gatewaynet.com ([193.92.121.98]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fdvYX-0004UT-T1 for pgsql-general@lists.postgresql.org; Fri, 13 Jul 2018 10:44:13 +0000 Received: from smadev.internal.net (pc131.internal.net [10.9.200.131]) by hermes.gatewaynet.com (8.14.3/8.14.3/Debian-9.4) with ESMTP id w6DAi0rT015148 for ; Fri, 13 Jul 2018 13:44:05 +0300 Received: from smadev.internal.net (smadev [10.9.200.131]) by smadev.internal.net (8.15.2/8.15.2) with ESMTP id w6DAhxN7060970 for ; Fri, 13 Jul 2018 13:43:59 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) Subject: Re: Monitor repl slot size To: pgsql-general@lists.postgresql.org References: From: Achilleas Mantzios Message-ID: <8eef4935-9a04-a70b-21f4-9ef76f1df12c@matrix.gatewaynet.com> Date: Fri, 13 Jul 2018 13:43:59 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------1F3EBAD673C39DB6E597CEAE" Content-Language: en-US X-Virus-Scanned: clamav-milter 0.98.7 at hermes X-Virus-Status: Clean X-Spam-Status: No, score=-28.0 required=5.0 tests=ALL_TRUSTED,DYN_HAM_COORD, DYN_HAM_IT,DYN_HAM_NAUTICAL,HTML_MESSAGE autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on hermes.gatewaynet.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------1F3EBAD673C39DB6E597CEAE Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 --------------1F3EBAD673C39DB6E597CEAE Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
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
--------------1F3EBAD673C39DB6E597CEAE--