Search Postgresql Archives

Logical replication lag in seconds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello!

I currently use Slony for replication and want to switch to logical
replication. With Slony I was aware of the replication lag of each slave
in seconds. This info was available regardless if a slave was online or
offline.

For my application I need to know the "delay" of all replicas, wether
they are currently active or not. I.e. a replica may be on the other
side of the world, serving queries there, but has problems to connect to
the master. Even in this case I need to know the replication status of
the replica.

With logical replication, it seems the only available data, eve in case
a replica is offline, is in the pg_replication_slots table, for example:

-[ RECORD 1 ]-------+---------------
slot_name           | test_6
plugin              | pgoutput
slot_type           | logical
datoid              | 16402
database            | mydns
temporary           | f
active              | f
active_pid          |
xmin                |
catalog_xmin        | 1116191193
restart_lsn         | 2EA/E61E7FA8
confirmed_flush_lsn | 2EA/E626F0B0

So I guess, the replication status of this replica is the
"confirmed_flush_lsn", ie: 2EA/E626F0B0

But how to I get from 2EA/E626F0B0 to a timestamp when this transaction
was added to the WAL files?

I would appreciate any hints, or other methods to get the delay in some
time format.

thanks
Klaus






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux