pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sergey Arlashin <sergeyarl.maillist@gmail.com>
To: Matheus de Oliveira <matioli.matheus@gmail.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: PostgreSQL 9.3 synchronous replication
Date: Wed, 21 Jan 2015 19:21:43 +0400
Message-ID: <4D515075-C030-4E13-80E8-42C3F6A7FC80@gmail.com> (raw)
In-Reply-To: <CAJghg4KkZC-F1QysXFSn_PvdjtV2eaxnd3NKKAp_sodH3NHRFg@mail.gmail.com>
References: <B0A4903C-64EA-4DE1-8676-F1177928F6AB@gmail.com>
	<CAJghg4KkZC-F1QysXFSn_PvdjtV2eaxnd3NKKAp_sodH3NHRFg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>


On Jan 21, 2015, at 3:34 PM, Matheus de Oliveira <matioli.matheus@gmail.com> wrote:

> 
> On Wed, Jan 21, 2015 at 6:25 AM, Sergey Arlashin <sergeyarl.maillist@gmail.com> wrote:
> Recently I've found out that synchronous replication just guarantees that the commit has reached the transaction log on the slave. Therefore that doesn't mean the slave has replayed the transaction log and a query against the slave will show the transaction's results.
> 
> 
> The exact guarantee depends on synchronous_commit configuration, but none provides guarantee that the xlog records have been applied and ready to query, you are right about it.
> 
>  
> So I'm wondering if there is a way to ensure that once a transaction is committed the data is available on the slave and I can get it by executing a query against the slave?
> 
> Well, you can use compare the values of pg_current_xlog_location on the master immediately after commit and pg_last_xlog_replay_location on the slave (or even use pg_stat_replication.replay_location).
> 

Yes, I understand this. But I was wondering whether it is possible to somehow force this procedure. Or wait until xlog is applied on slave and  only then consider the transaction committed. 
Or at least improve the ability of slave to apply xlogs? 

--
Best regards,
Sergey Arlashin


> Regards,
> -- 
> Matheus de Oliveira
> Analista de Banco de Dados
> Dextra Sistemas - MPS.Br nĂ­vel F!
> www.dextra.com.br/postgres
> 

view thread (7+ messages)  latest in thread

Message-ID: <4D515075-C030-4E13-80E8-42C3F6A7FC80@gmail.com>
Permalink:  ../4D515075-C030-4E13-80E8-42C3F6A7FC80@gmail.com/
Also on:    postgresql.org/message-id/4D515075-C030-4E13-80E8-42C3F6A7FC80@gmail.com

 · 

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: sergeyarl.maillist@gmail.com, matioli.matheus@gmail.com
  Subject: Re: PostgreSQL 9.3 synchronous replication
  In-Reply-To: <4D515075-C030-4E13-80E8-42C3F6A7FC80@gmail.com>

* 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