Re: 2PC transaction id

Поиск
Список
Период
Сортировка
Искать
От
Heikki Linnakangas
Тема
Re: 2PC transaction id
Дата
Msg-id
Pine.OSF.4.61.0507010936160.475909@kosh.hut.fi
Ответ на
Re: 2PC transaction id (Oliver Jowett)
Список
Дерево обсуждения
2PC transaction id Dave Cramer <pg@fastcrypt.com>
Re: 2PC transaction id Alvaro Herrera <alvherre@surnet.cl>
Re: 2PC transaction id Dave Cramer <pg@fastcrypt.com>
Re: 2PC transaction id Tom Lane <tgl@sss.pgh.pa.us>
Re: 2PC transaction id Oliver Jowett <oliver@opencloud.com>
Re: 2PC transaction id Dave Cramer <pg@fastcrypt.com>
Re: 2PC transaction id Oliver Jowett <oliver@opencloud.com>
Re: 2PC transaction id Dave Cramer <pg@fastcrypt.com>
Re: 2PC transaction id Oliver Jowett <oliver@opencloud.com>
Re: 2PC transaction id Tom Lane <tgl@sss.pgh.pa.us>
Re: 2PC transaction id Oliver Jowett <oliver@opencloud.com>
Re: 2PC transaction id Tom Lane <tgl@sss.pgh.pa.us>
Re: 2PC transaction id Oliver Jowett <oliver@opencloud.com>
Re: 2PC transaction id Oliver Jowett <oliver@opencloud.com>
Re: 2PC transaction id Heikki Linnakangas <hlinnaka@iki.fi>
Re: 2PC transaction id Heikki Linnakangas <hlinnaka@iki.fi>
Re: 2PC transaction id Bruce Momjian <pgman@candle.pha.pa.us>
Re: 2PC transaction id Kenneth Marshall <ktm@it.is.rice.edu>
Re: 2PC transaction id Tom Lane <tgl@sss.pgh.pa.us>
Re: 2PC transaction id Oliver Jowett <oliver@opencloud.com>
On Fri, 1 Jul 2005, Oliver Jowett wrote:

> Ok, so how do we get XA working when a single global transaction
> involves two databases on the same cluster?
>
> The scenario is:
>
> - there are two independent resource managers participating in a single
> global transaction
> - each resource manager has a connection to the database it is managing,
> and a SQL-level transaction running against that database
> - the global TM tells both resource managers to prepare their part of
> the global transaction, passing the same XID to both

If the TM does that, it's broken.

The XID consists of three parts:

format id: a constant. Not interesting.

gtrid: Global Transaction Identifier. This identifies the global 
transaction in the TM. All XIDs that have the same gtrid should be 
completed atomically by the TM

branch id: Branch Identifier. Every RM involved in the global transaction 
is given a *different* branch id.

In the above case, the TM would give the two resource managers XIDs that 
have the same gtrid but different branch ids.

From the RM point of view, those fields have no significance and the XID 
as whole is used to identify the transaction.

So the RM should never see the same XID twice, except when the TM 
specifically uses the TMJOIN or the TMSUSPEND/TMRESUME flags. If the TM 
uses those flags, it'll only issue one prepare.

- Heikki

В списке pgsql-hackers по дате отправления
От: Qingqing Zhou
Дата:
От: Dave Page
Дата:
FAQ