Re: Null value returned by function pg_last_wal_receive_lsn()inLogical Replication

Поиск
Список
Период
Сортировка
От soumitra bhandary
Тема Re: Null value returned by function pg_last_wal_receive_lsn()inLogical Replication
Дата
Msg-id MA1PR0101MB1687AEC7E3ACC54F999B6E44E0E70@MA1PR0101MB1687.INDPRD01.PROD.OUTLOOK.COM
обсуждение исходный текст
Ответы Re: Null value returned by function pg_last_wal_receive_lsn()inLogical Replication  (pavan95 <pavan.postgresdba@gmail.com>)
Список pgsql-admin
Hi Pavan , 

Please try below query , this should give you retention lag bytes in case of logical replication  . 

SELECT
      slot_name, database, active,
      pg_xlog_location_diff(pg_current_xlog_insert_location(), restart_lsn) AS retained_bytes
    FROM pg_replication_slots;

Thanks , 
Soumitra 

From: pavan95 <pavan.postgresdba@gmail.com>
Sent: Tuesday, October 9, 2018 11:29 AM
To: pgsql-admin@postgresql.org
Subject: Re: Null value returned by function pg_last_wal_receive_lsn() inLogical Replication
 
Hi Community,

I configured Logical Replication in Postgres 10.5 using 2 nodes(Publisher
and Subscriber). I'm in my way to find lag in logical replication.

>From the documentation I found that, pg_current_wal_lsn() on the publisher
and pg_last_wal_receive_lsn() on the subscriber helps us to find the lag in
which the subscriber is falling behind.

But, the function pg_last_wal_receive_lsn() is continuously returning NULL
value. In fact, all the Recovery Information
Functions(pg_last_wal_receive_lsn(),pg_last_wal_replay_lsn(),pg_last_xact_replay_timestamp())
are returning null. 

>From the Subscriber:

subscriber_db=# select pg_last_wal_receive_lsn();
 pg_last_wal_receive_lsn
-------------------------

(1 row)


But according to documentation, the above 3 functions will return NULL only
if streaming replication is disabled or if it has not yet started. But in my
case, the logical replication is working fine. So I wanted to know if I
could get a value by enabling any settings recommended.

Also, is there a query to find the lag in bytes between publisher and
subscriber?

Thanks in Advance.



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-admin-f2076596.html

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

Предыдущее
От: pavan95
Дата:
Сообщение: Re: Null value returned by function pg_last_wal_receive_lsn() inLogical Replication
Следующее
От: Mariel Cherkassky
Дата:
Сообщение: understand query on partition table