Re: Two-phase commit for 8.1 - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Two-phase commit for 8.1
Date
Msg-id Pine.OSF.4.61.0501231916520.414393@kosh.hut.fi
Whole thread Raw
In response to Re: Two-phase commit for 8.1  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Responses Re: Two-phase commit for 8.1  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
List pgsql-hackers
On Sun, 23 Jan 2005, Alvaro Herrera wrote:

> On Sun, Jan 23, 2005 at 01:37:30PM +0200, Heikki Linnakangas wrote:
>
>> As the patch gets more attention, I'm sure more issues will come up.

> I see the changes to the lock manager are huge.  Can you explain what's
> the idea behind those?  Do you release the locks and then reacquire
> them, or do you reassign them to a pseudo process?

I reassign them to a pseudo process (persistedLocksProc).

Much of the changes in lock.c are just about moving code around. 
Some copy-paste code has been put in functions. LockAcquire has been
changed to take PGPROC as an argument, so that locks can be acquired on 
behalf of the pseudo process.

Then there's completely new code for persisting locks on PREPARE 
TRANSACTION and reacquiring them on recovery.

If it helps, I could try to split it into two patches, one with code 
rearrangements that don't change current behaviour, and then the actual 
2PC stuff on top of that.

> Are there possibilities of deadlock somewhere?

Not that I know of.

- Heikki


pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [PATCHES] Merge pg_shadow && pg_group -- UNTESTED
Next
From: "Marc G. Fournier"
Date:
Subject: Re: 8.1 development cycle (was a couple of other threads