From: Hannu Krosing <hannu@2ndquadrant.com>
To: Craig Ringer <craig@postnewspapers.com.au>
Cc: Jeff Davis <pgsql@j-davis.com>
Cc: Merlin Moncure <mmoncure@gmail.com>
Cc: elias ghanem <e.ghanem@acteos.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Is DBLINK transactional
Date: Sat, 13 Mar 2010 14:18:55 +0200
Message-ID: <1268482735.3629.6.camel@hvost> (raw)
In-Reply-To: <4B9B80C9.4010004@postnewspapers.com.au>
References: <201003121524.o2CFOD26012586@relay-ext.ornis.com>
<b42b73151003120907n1f977887y6132a564af9260b3@mail.gmail.com>
<1268430857.32299.11.camel@monkey-cat.sm.truviso.com>
<4B9B80C9.4010004@postnewspapers.com.au>
On Sat, 2010-03-13 at 20:10 +0800, Craig Ringer wrote:
> On 13/03/2010 5:54 AM, Jeff Davis wrote:
> > On Fri, 2010-03-12 at 12:07 -0500, Merlin Moncure wrote:
> >> of course. You can always explicitly open a transaction on the remote
> >> side over dblink, do work, and commit it at the last possible moment.
> >> Your transactions aren't perfectly synchronized...if you crash in the
> >> precise moment between committing the remote and the local you can get
> >> in trouble. The chances of this are extremely remote though.
> >
> > If you want a better guarantee than that, consider using 2PC.
>
> Translation in case you don't know: 2PC = two phase commit.
>
> Note that you have to monitor "lost" transactions that were prepared for
> commit then abandoned by the controlling app and periodically get rid of
> them or you'll start having issues.
And you still have the problem of committing one 2PC transaction and
then crashing before committing the other and then crashing the
transaction monitor before being able to record what crashed :P, though
this possibility is even more remote than just crashing between the 2
original commits (dblink and local).
To get around this fundamental problem, you can actually do async queues
and remember, what got replayed on the remote side, so if you have
crashes on either side, you can simply replay again.
> > The problem with things that are "extremely remote" possibilities are
> > that they tend to be less remote than we expect ;)
>
> ... and they know just when they can happen despite all the odds to
> maximise the pain and chaos caused.
>
> --
> Craig Ringer
>
--
Hannu Krosing http://www.2ndQuadrant.com
PostgreSQL Scalability and Availability
Services, Consulting and Training
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-performance@postgresql.org
Cc: hannu@2ndquadrant.com, craig@postnewspapers.com.au, pgsql@j-davis.com, mmoncure@gmail.com, e.ghanem@acteos.com
Subject: Re: Is DBLINK transactional
In-Reply-To: <1268482735.3629.6.camel@hvost>
* 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