Re: write ahead logging in standby (streaming replication)

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Markus Wanner <markus(at)bluegap(dot)ch>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: write ahead logging in standby (streaming replication)
Date: 2009-11-16 20:57:10
Message-ID: 4B01BCA6.7050806@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)2ndQuadrant(dot)com www.2ndQuadrant.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-11-16 21:01:53 Re: UTF8 with BOM support in psql
Previous Message Andreas Kretschmer 2009-11-16 20:53:42 Re: Update on Insert