pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Damir Markovic <damir@damirda.com>
To: pgsql-general@lists.postgresql.org
Subject: Monitoring warm standby
Date: Thu, 14 Mar 2019 13:02:38 +0100
Message-ID: <CAMLLpyibzuS_CLv_m3ZxStE+fsnYYVannBh2mrHNXhC085pcGA@mail.gmail.com> (raw)

I have multiple warm standby replicas of PostgreSQL 11, used by analytics.
Some of the databases are not very active and I have a problem to figure
out if the recovery is in progress or actually there is nothing to recover
(because of master inactivity).

I set target time on replica like this:
recovery_target_time = '2019-03-13 12:00:00 UTC'

I check pg_is_wal_replay_paused() - false. Ok, replica is still catching up.

select max(modification) from pg_ls_waldir(); - '2019-03-13 10:25:15'. Ok,
I didn't receive any WAL files in a while.

select pg_last_xact_replay_timestamp(); - '2019-03-13 10:15:42.289668'.
Last transaction is even older.

The question now is how can I know if that last WAL file downloaded is
fully processed or maybe there is a long running transaction that is still
being in progress?

Thank you very much,
Damir

Message-ID: <CAMLLpyibzuS_CLv_m3ZxStE+fsnYYVannBh2mrHNXhC085pcGA@mail.gmail.com>
Permalink:  ../CAMLLpyibzuS_CLv_m3ZxStE+fsnYYVannBh2mrHNXhC085pcGA@mail.gmail.com/
Also on:    postgresql.org/message-id/CAMLLpyibzuS_CLv_m3ZxStE+fsnYYVannBh2mrHNXhC085pcGA@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: damir@damirda.com
  Subject: Re: Monitoring warm standby
  In-Reply-To: <CAMLLpyibzuS_CLv_m3ZxStE+fsnYYVannBh2mrHNXhC085pcGA@mail.gmail.com>
  References: <CAMLLpyibzuS_CLv_m3ZxStE+fsnYYVannBh2mrHNXhC085pcGA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox