Re: [External] Re: WAL Replication query - Mailing list pgsql-admin

From Ron
Subject Re: [External] Re: WAL Replication query
Date
Msg-id 54ba769f-7361-5df9-75fa-43669faf701e@gmail.com
Whole thread Raw
In response to Re: [External] Re: WAL Replication query  (KK CHN <kkchn.in@gmail.com>)
List pgsql-admin
On 11/1/22 23:00, KK CHN wrote:
[snip]
So there will be an inconsistency in the data  between the current  Primary  ( promoted standby)  and my recovered /repaired old server ( which was primary before the crash).  

   How to handle this data inconsistency or what best mechanism needs to be implemented if you were me in this  use case scenario?  

Before promoting Secondary to New Primary, I'd record it's current pg_stat_replication.replay_lsn value somewhere and then compare it to the relevant LSN on Old Primary when it comes back up.

If they're the same, then there's no data inconsistency.

If there is, then you've got to manually check tables, since every application and database structure is different

--
Angular momentum makes the world go 'round.

pgsql-admin by date:

Previous
From: KK CHN
Date:
Subject: Re: [External] Re: WAL Replication query
Next
From: Laurenz Albe
Date:
Subject: Re: [External] Re: WAL Replication query