pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: KK CHN <kkchn.in@gmail.com>
Cc: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: [External] Re: WAL Replication query
Date: Wed, 02 Nov 2022 07:11:05 +0100
Message-ID: <e86846e1f9bc1bb8339cf9709bf3a09100bbb680.camel@cybertec.at> (raw)
In-Reply-To: <CAKgGyB-faJD0QyOS8sLDuU7H9f+bWtE0phh1WE0Dhn5z-xvn3A@mail.gmail.com>
References: <CAKgGyB-SMT0RxeoifAfjkRx6RHEOgpn7sf8F_zD1DPsKydTu=w@mail.gmail.com>
	<88faef33e966796226022d6e7f3e32ad6c59fcfd.camel@cybertec.at>
	<MW4PR20MB4525ED0222DDE9FED0519D8FF3369@MW4PR20MB4525.namprd20.prod.outlook.com>
	<c1b6b89d6b89706acaeca9b4d45958f4739c4f28.camel@cybertec.at>
	<8f9e6c92-4daa-a543-6825-05a3503f4296@gmail.com>
	<f78c361061449be8402922cd5ed7f5782f65aab1.camel@cybertec.at>
	<42306ea2-74c2-a95e-551d-e1d16946c083@gmail.com>
	<cff94aa50765b00e798d15a5419830c82f8049ec.camel@cybertec.at>
	<CAKgGyB-faJD0QyOS8sLDuU7H9f+bWtE0phh1WE0Dhn5z-xvn3A@mail.gmail.com>

On Wed, 2022-11-02 at 09:30 +0530, KK CHN wrote:
>   I  mean when the Primary Server crashes due to a H/W failure or whatever other reason,
> Then   in my case  I am forced to  promote the Standby server as  Primary until the
> old  primary  server H/W vendor replaces the hardware component( it may vary from hours to days as pre SLA  terms with H/W vendor).  
> 
> In this scenario  any transactions happened in  crashed Primary server which were not transferred due to the
> delay in transfer to the Standby server.  But   I am in need to promote the Standby to Primary and
> it will run for another one day or two, until my  Old crashed server failed component is replaced with a new H/W part.   
> 
> 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?

Thanks for the clarification.

Yes, in that case you can lose committed data.  The normal way to avoid that is to use
synchronous replication.  That is easy to set up, but has some implications:

- it will slow down data modifications considerably
- you should have a low network latency between the machines
- the whole system becomes unavailable if the standby goes down, so have at
  least two synchronous standbys if you want good availability

Yours,
Laurenz Albe





view thread (15+ messages)  latest in thread

Message-ID: <e86846e1f9bc1bb8339cf9709bf3a09100bbb680.camel@cybertec.at>
Permalink:  ../e86846e1f9bc1bb8339cf9709bf3a09100bbb680.camel@cybertec.at/
Also on:    postgresql.org/message-id/e86846e1f9bc1bb8339cf9709bf3a09100bbb680.camel@cybertec.at

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, kkchn.in@gmail.com, ronljohnsonjr@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: [External] Re: WAL Replication query
  In-Reply-To: <e86846e1f9bc1bb8339cf9709bf3a09100bbb680.camel@cybertec.at>

* 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