Re: Limit of WAL LSN value of type pg_lsn - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: Limit of WAL LSN value of type pg_lsn
Date
Msg-id CAExHW5u94n4NRZm312iy3ypOtT-1anXkdV1zLLoRML9jO0XAfw@mail.gmail.com
Whole thread Raw
In response to Limit of WAL LSN value of type pg_lsn  (Shubham Shingne <shubham.s.shingne@gmail.com>)
List pgsql-hackers
Hi Shubham,

On Mon, Oct 31, 2022 at 11:04 AM Shubham Shingne
<shubham.s.shingne@gmail.com> wrote:
>
> Hi all,
>
> I am trying to determine optimal standby for automatic failover based on pg_last_wal_recieve_lsn() value of all
slaves.
>
> But what if max_wal_size is reached, is LSN value reset to zero.

Per https://www.postgresql.org/docs/current/runtime-config-wal.html
max_wal_size affects how frequently checkpoints are run. It doesn't
specify the limit on WAL produced by a given server. Probably
max_wal_size is a misnomer.

LSN is never reset to zero AFAIU.

>
> Please share some documentation that mentions clarification.
>
> Also suggest if there is any better approach to get node with best RPO out of all slaves.

It depends upon the method used to maintain slaves. Googling "RPO
postgresql" provides a lot of links. I found
http://www.postgresql-blog.com/postgresql-backup-strategy-recovery-pitr-wal/
to be a good start. But there are many others which seem to be useful
too.

-- 
Best Wishes,
Ashutosh Bapat



pgsql-hackers by date:

Previous
From: Aleksander Alekseev
Date:
Subject: Re: ResourceOwner refactoring
Next
From: Tom Lane
Date:
Subject: Re: Simplifying our Trap/Assert infrastructure