pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Shital A <brightuser2019@gmail.com>
To: pgsql-general@postgresql.org
Subject: Re: Urgent :: Postgresql streaming replication issue - sync mode
Date: Thu, 03 Oct 2019 13:41:16 +0200
Message-ID: <fcd59fb202ea2d6be8978debdf33d232f8eb76fd.camel@cybertec.at> (raw)
In-Reply-To: <CAMp7vw_A7rMTenPqc_NpqTPoMXtcGgeWreHBza5gKis-imXYNQ@mail.gmail.com>
References: <CAMp7vw_A7rMTenPqc_NpqTPoMXtcGgeWreHBza5gKis-imXYNQ@mail.gmail.com>

On Wed, 2019-10-02 at 23:58 +0530, Shital A wrote:
> We are seeing a strange issue with postgresql streaming application
> in sync mode. 
> 
> We are using postgresql 9.6. Old version because of some specific
> requirements.  We have setup cluster with master-standby using
> pacemaker. 
> 
> When we kill master using killall -9 postgres. The failed primary has
> few records extra than standby node. We have done setup with
> synchronous_commit = remote_apply and have set
> synchronous_standby_names=server_name. 
> 
> As the failed primary is having more data, How is it possible that
> primary is committing transaction before they were applied on standby
> with synchronous_commit=remote_apply?
> 
> 
> Please share if you have any thoughts. Are we missing any config ?

This is to be expected.

The transaction will be committed on the primary, then on the standby,
and COMMIT will only return once the standby reports success.

But the transacaction still has to be committed on the primary first.

If the standby sis promoted while COMMIT is waiting for the standby,
you can end up with the transaction committed on the primary,
but not yet committed on the standby.

You should use "pg_rewind" on the failed primary if you want to use
it as new standby for the promoted server.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






view thread (7+ messages)  latest in thread

Message-ID: <fcd59fb202ea2d6be8978debdf33d232f8eb76fd.camel@cybertec.at>
Permalink:  ../fcd59fb202ea2d6be8978debdf33d232f8eb76fd.camel@cybertec.at/
Also on:    postgresql.org/message-id/fcd59fb202ea2d6be8978debdf33d232f8eb76fd.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 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: laurenz.albe@cybertec.at, brightuser2019@gmail.com
  Subject: Re: Urgent :: Postgresql streaming replication issue - sync mode
  In-Reply-To: <fcd59fb202ea2d6be8978debdf33d232f8eb76fd.camel@cybertec.at>
  References: <CAMp7vw_A7rMTenPqc_NpqTPoMXtcGgeWreHBza5gKis-imXYNQ@mail.gmail.com> <fcd59fb202ea2d6be8978debdf33d232f8eb76fd.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