You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I found pgdoctor using next query to determine replication lag: "SELECT extract('epoch' from " \ "(now()-pg_last_xact_replay_timestamp())) " \ "AS replication_lag;"
This query may return incorrect value in case when there are no updates for database for some period. So if last update (delete or insert) was, for example, a hour ago this query will return value of replication_lag eq to 1 hour but it is not true! There are just no new date, so actually no replication lag.
The text was updated successfully, but these errors were encountered:
The main reason pgDoctor relies on the time difference is that on a typical production system where you are leveraging streaming replicas for offloading SELECT traffic, the load is probably high enough that there are never long periods without any INSERT/UPDATE/DELETE commands.
This has indeed served us well at Thumbtack over the last few years.
Would you propose any other approach we could possibly implement alongside this one?
As I found pgdoctor using next query to determine replication lag:
"SELECT extract('epoch' from " \ "(now()-pg_last_xact_replay_timestamp())) " \ "AS replication_lag;"
This query may return incorrect value in case when there are no updates for database for some period. So if last update (delete or insert) was, for example, a hour ago this query will return value of replication_lag eq to 1 hour but it is not true! There are just no new date, so actually no replication lag.
The text was updated successfully, but these errors were encountered: