LWN.net Logo

Synchronous replication! Yay!

Synchronous replication! Yay!

Posted May 5, 2011 20:25 UTC (Thu) by Cyberax (✭ supporter ✭, #52523)
In reply to: Synchronous replication! Yay! by intgr
Parent article: New features in PostgreSQL 9.1

Ok, I'm confused.

What happens when I commit a transaction? I understand that by the time COMMIT completes, the data is replicated to all the slaves. Right?


(Log in to post comments)

Synchronous replication! Yay!

Posted May 6, 2011 7:30 UTC (Fri) by intgr (subscriber, #39733) [Link]

Yes, by the end of COMMIT, the WAL data from the transaction is replicated to the slaves, but changes from the WAL haven't been applied to slave databases yet -- so not visible to queries. Applying/recovering the WAL on slaves still takes place asynchronously.

In the event of a failover/promotion, PostgreSQL applies all outstanding WAL changes, so no data is lost.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds