Re: Two-phase commit for 8.1

Lists: pgsql-hackers
From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Two-phase commit for 8.1
Date: 2005-01-19 18:55:57
Message-ID: Pine.OSF.4.61.0501192055310.62540@kosh.hut.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

Now that we got 8.0 out of the door, I'm submitting my two-phase commit patch
again for discussion.

http://www.hut.fi/~hlinnaka/pgsql/

Do we want it in 8.1, if we want a short development cycle? It needs a new
pg_twophase subdirectory, and it introduces a new system view, so I guess it
requires an initdb (or pg_upgrade).

Any comments on the implementation or the new commands?

I would appreciate help testing the JDBC driver with an application server that
does XA recovery properly.

- Heikki


From: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Two-phase commit for 8.1
Date: 2005-01-19 20:58:55
Message-ID: 20050119165747.U47533@ganymede.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


If the patch is ready to be committed early in the cycle, I'd say most
definitely ... just depends on how late in the cycle its ready ...

I *believe* that 8.1, we're looking at a 2mo cycle before beta, so figure
beta for ~April 1st (no april fools jokes, eh?) ...

On Wed, 19 Jan 2005, Heikki Linnakangas wrote:

> Hi,
>
> Now that we got 8.0 out of the door, I'm submitting my two-phase commit patch
> again for discussion.
>
> http://www.hut.fi/~hlinnaka/pgsql/
>
> Do we want it in 8.1, if we want a short development cycle? It needs a new
> pg_twophase subdirectory, and it introduces a new system view, so I guess it
> requires an initdb (or pg_upgrade).
>
> Any comments on the implementation or the new commands?
>
> I would appreciate help testing the JDBC driver with an application server
> that does XA recovery properly.
>
> - Heikki
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy(at)hub(dot)org Yahoo!: yscrappy ICQ: 7615664


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Two-phase commit for 8.1
Date: 2005-01-20 00:42:03
Message-ID: 1115.1106181723@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Marc G. Fournier" <scrappy(at)postgresql(dot)org> writes:
> If the patch is ready to be committed early in the cycle, I'd say most
> definitely ... just depends on how late in the cycle its ready ...

My recollection is that it's quite far from being complete. I had hoped
to spend some time during the 8.1 cycle helping Heikki finish it up,
but if we stick to the 2-month-dev-cycle idea I'm afraid there's no way
it'll be done in time. I thought that "some time" would probably amount
to a solid man-month or so, and there's no way I can spend half my time
on just one feature for this cycle.

If Heikki wants this in for 8.1, the right thing to do is vote against
the short-dev-cycle idea. But we need a plausible answer about what to
do about ARC to make that credible...

regards, tom lane


From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Two-phase commit for 8.1
Date: 2005-01-20 09:16:53
Message-ID: 41EF7705.50705@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> If the patch is ready to be committed early in the cycle, I'd say most
> definitely ... just depends on how late in the cycle its ready ...
>
> I *believe* that 8.1, we're looking at a 2mo cycle before beta, so
> figure beta for ~April 1st (no april fools jokes, eh?) ...

You guys are crazy :) We haven't had a release cycle less than a year
in many, many releases :)

Chris


From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Two-phase commit for 8.1
Date: 2005-01-20 13:01:05
Message-ID: 200501200801.05089.xzilla@users.sourceforge.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thursday 20 January 2005 04:16, Christopher Kings-Lynne wrote:
> > If the patch is ready to be committed early in the cycle, I'd say most
> > definitely ... just depends on how late in the cycle its ready ...
> >
> > I *believe* that 8.1, we're looking at a 2mo cycle before beta, so
> > figure beta for ~April 1st (no april fools jokes, eh?) ...
>
> You guys are crazy :) We haven't had a release cycle less than a year
> in many, many releases :)
>

If ARC is deemed a serious enough problem that we need to address it *now*,
then I think we should do a 2 month cycle where core focus will be on putting
in an ARC replacement and allowing only changes that do not require an
initdb. If we stick to that we can do a new release in probably 3-4 months
and I think that will be acceptable as long as dump/reload is not required
for upgrade. I still think it might be worth contacting IBM and asking them
if thier intention is to enforce the ARC patent if it is granted before
pushing forward with that plan, but it seems like a good course of action to
follow just in case. If others felt strongly, we could probably start an 8.2
branch right now as well and put someone like Neil in charge of keeping 8.2
up to date with 8.1 changes while proceeding forward with other new whizbang
functionality that requires initdb (I pick Neil cause iirc he has some initdb
requiring changes planned for development, but it could be someone else).

--
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


From: Kenneth Marshall <ktm(at)it(dot)is(dot)rice(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Two-phase commit for 8.1
Date: 2005-01-20 13:29:34
Message-ID: 20050120132934.GC14816@it.is.rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Jan 19, 2005 at 07:42:03PM -0500, Tom Lane wrote:
> "Marc G. Fournier" <scrappy(at)postgresql(dot)org> writes:
> > If the patch is ready to be committed early in the cycle, I'd say most
> > definitely ... just depends on how late in the cycle its ready ...
>
> My recollection is that it's quite far from being complete. I had hoped
> to spend some time during the 8.1 cycle helping Heikki finish it up,
> but if we stick to the 2-month-dev-cycle idea I'm afraid there's no way
> it'll be done in time. I thought that "some time" would probably amount
> to a solid man-month or so, and there's no way I can spend half my time
> on just one feature for this cycle.
>
> If Heikki wants this in for 8.1, the right thing to do is vote against
> the short-dev-cycle idea. But we need a plausible answer about what to
> do about ARC to make that credible...
>

I think the idea of making a buffer management algorithm API and then
preparing a simple LRU algorithm to have ready to plug in if the ARC
patent is granted would be doable in a short development cycle. Then
we can take advantage of as well as test other algorithms more easily.

Ken


From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Two-phase commit for 8.1
Date: 2005-01-21 18:44:43
Message-ID: Pine.OSF.4.61.0501212033520.352045@kosh.hut.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, 19 Jan 2005, Tom Lane wrote:

> "Marc G. Fournier" <scrappy(at)postgresql(dot)org> writes:
>> If the patch is ready to be committed early in the cycle, I'd say most
>> definitely ... just depends on how late in the cycle its ready ...
>
> My recollection is that it's quite far from being complete. I had hoped
> to spend some time during the 8.1 cycle helping Heikki finish it up,
> but if we stick to the 2-month-dev-cycle idea I'm afraid there's no way
> it'll be done in time. I thought that "some time" would probably amount
> to a solid man-month or so, and there's no way I can spend half my time
> on just one feature for this cycle.
>
> If Heikki wants this in for 8.1, the right thing to do is vote against
> the short-dev-cycle idea. But we need a plausible answer about what to
> do about ARC to make that credible...

I'm not sure what I want.

If the 8.1 cycle really is a short one, say 3 months, then I have no
problem waiting for 8.2. But we have a very bad track record regarding
short-dev-cycles. I honestly don't believe we can get 8.1 released before
July.

- Heikki


From: Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Two-phase commit for 8.1
Date: 2005-01-23 09:08:43
Message-ID: 41F3699B.2060608@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Heikki,

What is still missing to complete the 2PC patch?.

Regards,

Hans

Heikki Linnakangas wrote:
> On Wed, 19 Jan 2005, Tom Lane wrote:
>
>> "Marc G. Fournier" <scrappy(at)postgresql(dot)org> writes:
>>
>>> If the patch is ready to be committed early in the cycle, I'd say most
>>> definitely ... just depends on how late in the cycle its ready ...
>>
>>
>> My recollection is that it's quite far from being complete. I had hoped
>> to spend some time during the 8.1 cycle helping Heikki finish it up,
>> but if we stick to the 2-month-dev-cycle idea I'm afraid there's no way
>> it'll be done in time. I thought that "some time" would probably amount
>> to a solid man-month or so, and there's no way I can spend half my time
>> on just one feature for this cycle.
>>
>> If Heikki wants this in for 8.1, the right thing to do is vote against
>> the short-dev-cycle idea. But we need a plausible answer about what to
>> do about ARC to make that credible...
>
>
> I'm not sure what I want.
>
> If the 8.1 cycle really is a short one, say 3 months, then I have no
> problem waiting for 8.2. But we have a very bad track record regarding
> short-dev-cycles. I honestly don't believe we can get 8.1 released
> before July.
>
> - Heikki
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

--
Cybertec Geschwinde u Schoenig
Schoengrabern 134, A-2020 Hollabrunn, Austria
Tel: +43/660/816 40 77
www.cybertec.at, www.postgresql.at


From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Two-phase commit for 8.1
Date: 2005-01-23 11:37:30
Message-ID: Pine.OSF.4.61.0501231147320.64318@kosh.hut.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, 23 Jan 2005, Hans-Jürgen Schönig wrote:

> Heikki,
>
> What is still missing to complete the 2PC patch?.

Here's my TODO on things that need to be done:

* large objects
* guc variables
* notify/listen

Large objects and notify/listen should be quite straightforward. GUC
variables need some thinking, but shouldn't be much work.

As the patch gets more attention, I'm sure more issues will come up.

- Heikki


From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Two-phase commit for 8.1
Date: 2005-01-23 15:13:37
Message-ID: 20050123151337.GD4406@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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? Are there
possibilities of deadlock somewhere?

--
Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
Thou shalt study thy libraries and strive not to reinvent them without
cause, that thy code may be short and readable and thy days pleasant
and productive. (7th Commandment for C Programmers)


From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Two-phase commit for 8.1
Date: 2005-01-23 17:32:55
Message-ID: Pine.OSF.4.61.0501231916520.414393@kosh.hut.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 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


From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Two-phase commit for 8.1
Date: 2005-01-31 15:01:19
Message-ID: 20050131150119.GI22141@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, Jan 23, 2005 at 07:32:55PM +0200, Heikki Linnakangas wrote:

> 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.

I think that'd be a good idea, because such a patch could be merged
right now, and the actual 2PC stuff would be smaller and easier to
review.

You'd only need a committer to actually commit the initial patch ...

--
Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
"No hay cielo posible sin hundir nuestras raíces
en la profundidad de la tierra" (Malucha Pinto)