Re: Synchronous replication and read consistency - Mailing list pgsql-general

From Chris Mair
Subject Re: Synchronous replication and read consistency
Date
Msg-id e140b14d6593a417416f2399b5b667c4@smtp.hushmail.com
Whole thread Raw
In response to Re: Synchronous replication and read consistency  (Ravi Krishna <sravikrishna3@gmail.com>)
List pgsql-general
> Chris/Joshua
>
> I would like to know more details.
>
> As per this:
>
> http://www.postgresql.org/docs/current/static/warm-standby.html#SYNCHRONOUS-REPLICATION
>
> "When requesting synchronous replication, each commit of a write
> transaction will wait until confirmation is received that the commit
> has been written to the transaction log on disk of both the primary
> and standby server."
>


Ah, sorry I misread sync replication as streaming replication...


> Does it mean that, on the standby, when PG writes the transaction log
> on the disk, it also updates the data buffers to make the transaction
> visible for all sessions.
>
> Eg:
>
>   On the primary
>      A big transaction committed
>   Now if I issue a select on the primary looking for the transaction I
> committed above, I will get what I want.
> Will I get the same result if instead of primary I issue the select on
> the standby.
>
> Hope it is clear.


Synchronous replication is slower by nature. It will slow down the
master as well because each commit has to wait for a standby to ack it.

The answer to your question is still yes, you will get the same result
on the standby.

You will actually see less lag than with normal streaming replication
in the sense that the standby lagging several transactions behind due to
a commit/write burst on the master is not possible anymore. This
is of course at the expense of master-performance.


Bye,
Chris.






pgsql-general by date:

Previous
From: CS DBA
Date:
Subject: xmin horizon?
Next
From: AI Rumman
Date:
Subject: Re: Postgresql upgrade from 8.4 to latest