pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joshua Tolley <eggyknap@gmail.com>
To: Aidan Van Dyk <aidan@highrise.ca>
Cc: Robert Treat <rob@xzilla.net>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Sync Rep Design
Date: Thu, 30 Dec 2010 20:26:51 -0700
Message-ID: <4d1d4d96.c605ec0a.1af2.ffffb7ef@mx.google.com> (raw)
In-Reply-To: <AANLkTinV4hNPfBcozG-e+63-0BAxbhnsJdhVmdOu356A@mail.gmail.com>
References: <1293729972.1892.23804.camel@ebony>
	<4D1CC47E.7050207@kaltenbrunner.cc>
	<1293735853.1892.24886.camel@ebony>
	<AANLkTi=dr9TuYRLMWjPkJdL1Jjg+TAJXPJQbLGiN1Pag@mail.gmail.com>
	<AANLkTinV4hNPfBcozG-e+63-0BAxbhnsJdhVmdOu356A@mail.gmail.com>

On Thu, Dec 30, 2010 at 03:24:09PM -0500, Aidan Van Dyk wrote:
> On Thu, Dec 30, 2010 at 3:07 PM, Robert Treat <rob@xzilla.net> wrote:
> 
> >> If primary crashes while commits are waiting for acknowledgement, those
> >> transactions will be marked fully committed if the primary database
> >> recovers, no matter how allow_standalone_primary is set.
> >
> > This seems backwards; if you are waiting for acknowledgement, wouldn't the
> > normal assumption be that the transactions *didnt* make it to any standby,
> > and should be rolled back ?
> 
> This is the standard 2-phase commit problem.  The primary server *has*
> committed it, it's fsync has returned, and the only thing keeping it
> from returning the commit to the client is that it's waiting on a
> synchronous "ack" from a slave.

<snip>

> 2) initiate fsync on the primary first
>    - In this case, the slave is always slightly behind.  If if your
> primary falls over, you don't give commit messages to the clients, but
> if it recovers, it might have committed data, and slaves will still be
> able to catch up.
> 
> The thing is that currently, even without replication, #2 can happen.

For what little it's worth, I vote for this option, because it's a problem
that can already happen (as opposed to adding an entirely new type of problem
to the mix).

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com

Attachments:

  signature.asc (application/pgp-signature, 196B) download

view thread (99+ messages)  latest in thread

Message-ID: <4d1d4d96.c605ec0a.1af2.ffffb7ef@mx.google.com>
Permalink:  ../4d1d4d96.c605ec0a.1af2.ffffb7ef@mx.google.com/
Also on:    postgresql.org/message-id/4d1d4d96.c605ec0a.1af2.ffffb7ef@mx.google.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-hackers@postgresql.org
  Cc: eggyknap@gmail.com, aidan@highrise.ca, rob@xzilla.net, simon@2ndquadrant.com, stefan@kaltenbrunner.cc
  Subject: Re: Sync Rep Design
  In-Reply-To: <4d1d4d96.c605ec0a.1af2.ffffb7ef@mx.google.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