Re: [ADMIN] How to measure replication lag in logical replicationsetup.
От | Igor Neyman |
---|---|
Тема | Re: [ADMIN] How to measure replication lag in logical replicationsetup. |
Дата | |
Msg-id | CY1PR17MB04587C36946F2C2BBA45B2B3DA560@CY1PR17MB0458.namprd17.prod.outlook.com обсуждение исходный текст |
Ответ на | [ADMIN] How to measure replication lag in logical replication setup. (rammohan ganapavarapu <rammohanganap@gmail.com>) |
Ответы |
Re: [ADMIN] How to measure replication lag in logical replication setup.
|
Список | pgsql-admin |
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of rammohan ganapavarapu
Sent: Tuesday, November 07, 2017 9:52 PM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] How to measure replication lag in logical replication setup.
HI,
How to measure replication lag time in case of logical replication?
this query is returning empty
SELECT now() - pg_last_xact_replay_timestamp() AS time_lag;
time_lag
----------
(1 row)
this is my slot details
SELECT * FROM pg_replication_slots;
slot_name | plugin | slot_type | datoid | database | active | xmin | catalog_xmin | restart_lsn
-----------+--------+-----------+--------+----------+--------+------+--------------+-------------
slot_1 | | physical | | | t | 1983 | | 0/50805C8
In my case slot_type is physical, does it look ok or for logical replication the slot_type should be logical?
Thanks,
Ram
I compare confirmed_flush_lsn in PG_REPLICATION_SLOTS on the Publisher with pg_current_wal_lsn():
SELECT confirmed_flush_lsn, pg_current_wal_lsn(), (pg_current_wal_lsn() - confirmed_flush_lsn) AS lsn_distance
FROM pg_catalog.pg_replication_slots
WHERE slot_name = 'subscriber_1';
slot_type for logical replication is logical.
Slot was created “automatically”, when I created “subscriber_1” subscription.
Regards,
Igor Neyman
В списке pgsql-admin по дате отправления: