Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

Why does pg_last_xact_replay_timestamp() sometimes return extremely old timestamps?

$
0
0

In PostgreSQL 9.5, to monitor streaming replication lag, I use a combination of:

  • pg_current_xlog_location()
  • pg_last_xlog_replay_location()
  • pg_last_xact_replay_timestamp()

The first two functions are used to determine if there is any lag between the master and standby. If there is some lag, then I determine it with:

select now() - pg_last_xact_replay_timestamp();

Mostly it returns reasonable amounts -- seconds to minutes of lag. However occasionally, that statement will return unlikely, large values. Several days of lag.

We don't have any transactions in our system that run for that long, not even close.

Can anyone suggest what is going on here?


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>