Expose last replayed timeline ID along with last replayed LSN

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Expose last replayed timeline ID along with last replayed LSN
Date: 2022-07-19 08:58:40
Message-ID: CALj2ACWzf036eKo1D-uY6CqctyhZH8nvRHu5WYZkfC972CWD9w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

At times it's useful to know the last replayed WAL record's timeline
ID (especially on the standbys that are lagging in applying WAL while
failing over - for reporting, logging and debugging purposes). AFICS,
there's no function that exposes the last replayed TLI. We can either
change the existing pg_last_wal_replay_lsn() to report TLI along with
the LSN which might break the compatibility or introduce a new
function pg_last_wal_replay_info() that emits both LSN and TLI. I'm
fine with either of the approaches, but for now, I'm attaching a WIP
patch that adds a new function pg_last_wal_replay_info().

Thoughts?

Regards,
Bharath Rupireddy.

Attachment Content-Type Size
v1-0001-Add-new-function-pg_last_wal_replay_info.patch application/octet-stream 2.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message tanghy.fnst@fujitsu.com 2022-07-19 09:02:07 Memory leak fix in psql
Previous Message Morris de Oryx 2022-07-19 08:54:05 Re: System column support for partitioned tables using heap