Re: triggers on prepare, commit, rollback... ?

From: Hannu Krosing <hannu(at)krosing(dot)net>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: triggers on prepare, commit, rollback... ?
Date: 2008-05-20 11:09:26
Message-ID: 1211281766.8174.24.camel@huvostro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2008-05-20 at 12:09 +0200, Fabien COELHO wrote:

> As for replication, I was naively thinking of using BEFORE PREPARE to
> forward a prepare and possibly fail in the master if the slave fails, and
> then an AFTER PREPARE or BEFORE COMMIT/ROLLBACK PREPARE would forward the
> final COMMIT/ROLLBACK depending on the success of the prepare operation in
> the master and slaves. The function could also wait for something to
> finish on the slave.
>
> If the something fails in between, then there are several state
> combinations to detect and handle, but this is just the point of 2PC.
>
> I'm not claiming this is easy, on the contrary, but ISTM that the 2PC
> semantics is all what is fundamentaly needed to achieve synchroneous
> replication, and once hooks are available there should be a way to
> prototype something at the user level (slony style). The efficiency of the
> stuff is another issue, but some applications don't need high throughput
> and low latency, but just to know that the data are not lost.

There are probably easier solutions for achieving this, like using two
connections at client level or doing async replication, or running data
modifications through pl/proxy functions where partitioning function
always returns two partitions

---------------
Hannu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2008-05-20 11:30:47 Re: [rfc,patch] PL/Proxy in core
Previous Message Sam Mason 2008-05-20 10:37:35 Re: triggers on prepare, commit, rollback... ?