Re: [HACKERS] 2PC transaction id

2005-07-03 Thread Heikki Linnakangas
On Sat, 2 Jul 2005, Oliver Jowett wrote: Sorry to keep beating on this, but I still don't see where the spec says that you must have only one RM per transaction branch. Sure, it's important to get this right. 2.2.6 says: 2.2.6 Transaction Branches A global transaction has one or more trans

Re: [HACKERS] 2PC transaction id

2005-07-02 Thread Kenneth Marshall
It certainly helps if you need to debug a process. Ken On Fri, Jul 01, 2005 at 09:06:03PM +0300, Heikki Linnakangas wrote: > On Fri, 1 Jul 2005, Oliver Jowett wrote: > > >PS: noticed in passing: psql's help doesn't seem to know about the 2PC > >command syntax yet. > > True. > > Should we add s

Re: [HACKERS] 2PC transaction id

2005-07-01 Thread Oliver Jowett
Heikki Linnakangas wrote: > On Fri, 1 Jul 2005, Oliver Jowett wrote: >> >> That implies it's valid (in fact, normal!) to enlist many different RMs >> in the same transaction branch. Am I interpreting that correctly? > > > I see. No, I don't think that's the correct interpretation, though now > th

Re: [HACKERS] 2PC transaction id

2005-07-01 Thread Oliver Jowett
Tom Lane wrote: > regression=# \h commit prepared > Command: COMMIT PREPARED > Description: commit a transaction that was earlier prepared for two-phase > commit > > Syntax: > COMMIT PREPARED transaction_id Ah, I was looking under '\h commit', '\h prepare' etc. -O

Re: [HACKERS] 2PC transaction id

2005-07-01 Thread Tom Lane
Heikki Linnakangas <[EMAIL PROTECTED]> writes: > On Fri, 1 Jul 2005, Oliver Jowett wrote: >> PS: noticed in passing: psql's help doesn't seem to know about the 2PC >> command syntax yet. > True. Really? regression=# \h commit prepared Command: COMMIT PREPARED Description: commit a transactio

Re: [HACKERS] 2PC transaction id

2005-07-01 Thread Heikki Linnakangas
On Fri, 1 Jul 2005, Oliver Jowett wrote: PS: noticed in passing: psql's help doesn't seem to know about the 2PC command syntax yet. True. Should we add support for it? 2PC is not something you normally do interactively... - Heikki ---(end of broadcast)-

Re: [HACKERS] 2PC transaction id

2005-07-01 Thread Bruce Momjian
Heikki Linnakangas wrote: > On Fri, 1 Jul 2005, Oliver Jowett wrote: > > > PS: noticed in passing: psql's help doesn't seem to know about the 2PC > > command syntax yet. > > True. > > Should we add support for it? 2PC is not something you normally do > interactively... Yes, we should add psql

Re: [HACKERS] 2PC transaction id

2005-07-01 Thread Heikki Linnakangas
On Fri, 1 Jul 2005, Barry Lind wrote: I oversimplified a bit. The TM *can* enlist multiple threads of control (= connection in JTA) to the same transaction branch. That's called "tightly-coupled threads", and they should then be treated as one local transaction in the RM. The calls will look lik

Re: [HACKERS] 2PC transaction id

2005-07-01 Thread Heikki Linnakangas
On Fri, 1 Jul 2005, Oliver Jowett wrote: What I'm confused about is, for example, 3.3.1 in the DTP:XA spec: 3.3.1 Registration of Resource Managers Normally, a TM involves all associated RMs in a transaction branch. (The TMs set of RM switches, described in Section 4.3 on page 21 tells the T

Re: [HACKERS] 2PC transaction id

2005-07-01 Thread Barry Lind
>>> branch id: Branch Identifier. Every RM involved in the global >>> transaction is given a *different* branch id. >> >> Hm, I am confused then -- the XA spec definitely talks about enlisting >> multiple RMs in a single transaction branch. >> >> Can you explain? > >I oversimplified a bit. The TM *

Re: [HACKERS] 2PC transaction id

2005-07-01 Thread Oliver Jowett
Heikki Linnakangas wrote: > On Fri, 1 Jul 2005, Oliver Jowett wrote: > >> Heikki Linnakangas wrote: >> >>> branch id: Branch Identifier. Every RM involved in the global >>> transaction is given a *different* branch id. >> >> >> Hm, I am confused then -- the XA spec definitely talks about enlisting

Re: [HACKERS] 2PC transaction id

2005-07-01 Thread Heikki Linnakangas
On Fri, 1 Jul 2005, Oliver Jowett wrote: Heikki Linnakangas wrote: branch id: Branch Identifier. Every RM involved in the global transaction is given a *different* branch id. Hm, I am confused then -- the XA spec definitely talks about enlisting multiple RMs in a single transaction branch.

Re: [HACKERS] 2PC transaction id

2005-06-30 Thread Heikki Linnakangas
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 connec

Re: [HACKERS] 2PC transaction id

2005-06-30 Thread Oliver Jowett
Oliver Jowett wrote: > Tom Lane wrote: > >>It's the TM's responsibility to deal with that. I would expect it to >>hand out transaction IDs that consist of a common prefix and a >>per-database suffix, if it does not know which resources it's dealing >>with might share a common GID namespace. > I

Re: [HACKERS] 2PC transaction id

2005-06-30 Thread Oliver Jowett
Tom Lane wrote: > Oliver Jowett <[EMAIL PROTECTED]> writes: > >>Ok, so how do we get XA working when a single global transaction >>involves two databases on the same cluster? > > > It's the TM's responsibility to deal with that. I would expect it to > hand out transaction IDs that consist of a

Re: [HACKERS] 2PC transaction id

2005-06-30 Thread Tom Lane
Oliver Jowett <[EMAIL PROTECTED]> writes: > Ok, so how do we get XA working when a single global transaction > involves two databases on the same cluster? It's the TM's responsibility to deal with that. I would expect it to hand out transaction IDs that consist of a common prefix and a per-databa

Re: [HACKERS] 2PC transaction id

2005-06-30 Thread Oliver Jowett
Tom Lane wrote: > Oliver Jowett <[EMAIL PROTECTED]> writes: > >>Can we make the GID-to-internal-xid mapping for prepared transactions >>1:N rather than the current 1:1? > > > No. Ok, so how do we get XA working when a single global transaction involves two databases on the same cluster? The sc

Re: [HACKERS] 2PC transaction id

2005-06-30 Thread Tom Lane
Oliver Jowett <[EMAIL PROTECTED]> writes: > Can we make the GID-to-internal-xid mapping for prepared transactions > 1:N rather than the current 1:1? No. regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our

Re: [HACKERS] 2PC transaction id

2005-06-30 Thread Tom Lane
Dave Cramer <[EMAIL PROTECTED]> writes: > Do the transaction id's used in 2PC need to be unique across all > sessions? > Do we provide a mechanism for this ? > If not shouldn't we provide a way to create a unique transaction id ? I see no value in that at all. The point of 2PC is to synchronize

Re: [HACKERS] 2PC transaction id

2005-06-30 Thread Dave Cramer
On 30-Jun-05, at 8:00 PM, Oliver Jowett wrote: Dave Cramer wrote: I'm thinking of the situation where one transaction occurs on more than one backend, and there is more than one transaction manager. XA XIDs are *global* IDs, i.e. they are unique even with more than one TM involved. It's

Re: [HACKERS] 2PC transaction id

2005-06-30 Thread Oliver Jowett
Oliver Jowett wrote: > If you have two different databases involved in the same global > transaction, then yes, the two backends could be told to use the same > global XID. That's normal. (they don't *have* to be given the same XID > as they could be participating in two independent branches of th

Re: [HACKERS] 2PC transaction id

2005-06-30 Thread Oliver Jowett
Dave Cramer wrote: > I'm thinking of the situation where one transaction occurs on more than > one backend, and there is > more than one transaction manager. XA XIDs are *global* IDs, i.e. they are unique even with more than one TM involved. It's the responsibility of the TM to generate a globall

Re: [HACKERS] 2PC transaction id

2005-06-30 Thread Dave Cramer
I'm thinking of the situation where one transaction occurs on more than one backend, and there is more than one transaction manager. Dave On 30-Jun-05, at 7:37 PM, Oliver Jowett wrote: Dave Cramer wrote: Do the transaction id's used in 2PC need to be unique across all sessions? They a

Re: [HACKERS] 2PC transaction id

2005-06-30 Thread Oliver Jowett
Dave Cramer wrote: > Do the transaction id's used in 2PC need to be unique across all sessions? They are global IDs, yes. > Do we provide a mechanism for this ? > > If not shouldn't we provide a way to create a unique transaction id ? Well, in XA the XIDs are assigned by the TM, the individual

Re: [HACKERS] 2PC transaction id

2005-06-30 Thread Dave Cramer
In reality all it takes is a sequence, however if it were system generated it would be simpler Dave On 30-Jun-05, at 6:46 PM, Alvaro Herrera wrote: On Thu, Jun 30, 2005 at 06:39:43PM -0400, Dave Cramer wrote: Do the transaction id's used in 2PC need to be unique across all sessions? Yes.

Re: [HACKERS] 2PC transaction id

2005-06-30 Thread Alvaro Herrera
On Thu, Jun 30, 2005 at 06:39:43PM -0400, Dave Cramer wrote: > Do the transaction id's used in 2PC need to be unique across all > sessions? Yes. > Do we provide a mechanism for this ? Huh, the constraint is enforced by the server, but the ID is generated by the client. > If not shouldn't we p

[HACKERS] 2PC transaction id

2005-06-30 Thread Dave Cramer
Do the transaction id's used in 2PC need to be unique across all sessions? Do we provide a mechanism for this ? If not shouldn't we provide a way to create a unique transaction id ? Dave Cramer [EMAIL PROTECTED] www.postgresintl.com ICQ #14675561 jabber [EMAIL PROTECTED] ph (519 939 0336 )