Re: write ahead logging in standby (streaming replication) - Mailing list pgsql-hackers

From Greg Smith
Subject Re: write ahead logging in standby (streaming replication)
Date
Msg-id 4B01BCA6.7050806@2ndquadrant.com
Whole thread Raw
In response to Re: write ahead logging in standby (streaming replication)  (Markus Wanner <markus@bluegap.ch>)
Responses Re: write ahead logging in standby (streaming replication)
List pgsql-hackers
Markus Wanner wrote:
> You will definitely find different definitions and requirements of what
> synchronous replication means there. 
To quote from the Wikipedia entry on "Database Replication" that Simon 
pointed to during the earlier discussion, 
http://en.wikipedia.org/wiki/Database_replication

"Synchronous replication - guarantees "zero data loss" by the means of 
atomic write operation, i.e. write either completes on both sides or not 
at all. Write is not considered complete until acknowledgement by both 
local and remote storage."

That last part is the critical one:  "acknowledgement by both local and 
remote storage" is required before you can label something truly 
synchronous replication.  In implementation terms, that means you must 
have both local and slave fsync calls finish to be considered truly 
synchronous.  That part is not ambiguous at all.

There's a definition of the weaker form in there too, which is where the 
ambiguity is at:

"Semi-synchronous replication - this usually means that a write is 
considered complete as soon as local storage acknowledges it and a 
remote server acknowledges that it has received the write either into 
memory or to a dedicated log file."

I don't consider that really synchronous replication anymore, but as you 
say it's been strengthened by marketing enough to be a valid industry 
term at this point.  Since it's already gained traction we might use it, 
as long as it's defined properly and its trade-offs vs. a true 
synchronous implementation are documented.

-- 
Greg Smith    2ndQuadrant   Baltimore, MD
PostgreSQL Training, Services and Support
greg@2ndQuadrant.com  www.2ndQuadrant.com



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: UTF8 with BOM support in psql
Next
From: Andreas Kretschmer
Date:
Subject: Re: Update on Insert