Re: eXtensible Transaction Manager API

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: eXtensible Transaction Manager API
Date: 2015-11-09 09:21:11
Message-ID: CANP8+j+PB2SEWnVTfmbw63NnSrhjBLsk=e1r2ZfP=D6_dF0qPQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 8 November 2015 at 23:35, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:

> > COMMIT PREPARED is a pretty thin layer; the work is all done in the
> PREPARE.
> > With a DTM, the main commit itself is done once only in the DTM, so all
> the
> > COMMIT PREPARED would do is release local node resources.
>
> Sure. Now imagine that the pg_twophase entry is corrupted for this
> transaction on one node. This would trigger a PANIC on it, and
> transaction would not be committed everywhere. I am aware of the fact
> that by definition PREPARE TRANSACTION ensures that a transaction will
> be committed with COMMIT PREPARED, just trying to see any corner cases
> with the approach proposed. The DTM approach is actually rather close
> to what a GTM in Postgres-XC does :)
>

This is wrong.

There is no "approach proposed", this is just normal 2PC feature that
PostgreSQL has supported since 8.1. All that is proposed here is that we
have an API that allows this to be exposed.

The whole point of PREPARE is that it allows a database to crash after that
step and it can still be recovered. That has nothing to do with Xanything.

In this case, the role of the GTM is to record the commit. Other nodes
consult the GTM, not local state to see whether the transaction has
committed, acting as the transaction manager in an XA sense.

--
Simon Riggs http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/>
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2015-11-09 09:40:45 Re: Foreign join pushdown vs EvalPlanQual
Previous Message Ildus Kurbangaliev 2015-11-09 09:17:34 Re: [PATCH] Refactoring of LWLock tranches