Re: xlog directory at initdb time

Lists: pgsql-hackerspgsql-patches
From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: xlog directory at initdb time
Date: 2006-12-27 01:56:37
Message-ID: 20061227015637.GA3019@timbira.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Hi,
This simple patch lets someone specifies the xlog directory at initdb
time. It uses symlinks to do it, and create and/or set permissions at
the directory as appropriate.

--
Euler Taveira de Oliveira
http://www.timbira.com/

Attachment Content-Type Size
xlogdata.diff text/plain 8.4 KB

From: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
To: "Euler Taveira de Oliveira" <euler(at)timbira(dot)com>
Cc: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: xlog directory at initdb time
Date: 2006-12-27 21:34:04
Message-ID: 1167255245.3783.555.camel@silverbirch.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Tue, 2006-12-26 at 23:56 -0200, Euler Taveira de Oliveira wrote:

> This simple patch lets someone specifies the xlog directory at initdb
> time. It uses symlinks to do it, and create and/or set permissions at
> the directory as appropriate.

Looks good.

I'm no expert on coding style, so I won't comment on anything there.

Any test harness changes? Or a test script?

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com


From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: xlog directory at initdb time
Date: 2006-12-28 22:40:52
Message-ID: 20061228224052.GA3041@timbira.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Simon Riggs wrote:

> > This simple patch lets someone specifies the xlog directory at initdb
> > time. It uses symlinks to do it, and create and/or set permissions at
> > the directory as appropriate.
>
> Looks good.
>
> I'm no expert on coding style, so I won't comment on anything there.
>
> Any test harness changes? Or a test script?
>
Unfortunately, nope. :( I tested it manually.
How did i test it?

1) xlog directory doesn't exist -- OK
2) xlog directory exists -- OK
3) xlog directory exists but doesn't have the right permissions --
FAILED
4) xlog diretory exists but is not empty -- FAILED
5) interrupting initdb execution (Ctrl-C) to test the cleanup code -- OK

PS> i didn't test it in a win32 box but it should be ok.

--
Euler Taveira de Oliveira
http://www.timbira.com/


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org, Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Subject: Re: [PATCHES] xlog directory at initdb time
Date: 2007-01-02 10:43:53
Message-ID: 200701021143.56955.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Am Mittwoch, 27. Dezember 2006 02:56 schrieb Euler Taveira de Oliveira:
> This simple patch lets someone specifies the xlog directory at initdb
> time. It uses symlinks to do it, and create and/or set permissions at
> the directory as appropriate.

We already had this functionality in initdb a few versions ago. Did you
review why it was removed?
--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Subject: Re: [PATCHES] xlog directory at initdb time
Date: 2007-01-02 15:18:30
Message-ID: 3560.1167751110@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Am Mittwoch, 27. Dezember 2006 02:56 schrieb Euler Taveira de Oliveira:
>> This simple patch lets someone specifies the xlog directory at initdb
>> time. It uses symlinks to do it, and create and/or set permissions at
>> the directory as appropriate.

> We already had this functionality in initdb a few versions ago. Did you
> review why it was removed?

The discussion thread seems to start here:

http://archives.postgresql.org/pgsql-hackers/2002-08/msg00306.php

As best I can tell the objections came from the fact that Thomas had
implemented it as a postmaster-start-time switch, which made it a
foot-gun because you could mistakenly start the postmaster with a
different XLOG than you were using before. That would not apply to a
symlink-made-by-initdb approach. All this is doing is formalizing
something we already suggest people do by hand...

regards, tom lane


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Subject: Re: [PATCHES] xlog directory at initdb time
Date: 2007-01-02 19:00:27
Message-ID: 200701021900.l02J0RY05709@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > Am Mittwoch, 27. Dezember 2006 02:56 schrieb Euler Taveira de Oliveira:
> >> This simple patch lets someone specifies the xlog directory at initdb
> >> time. It uses symlinks to do it, and create and/or set permissions at
> >> the directory as appropriate.
>
> > We already had this functionality in initdb a few versions ago. Did you
> > review why it was removed?
>
> The discussion thread seems to start here:
>
> http://archives.postgresql.org/pgsql-hackers/2002-08/msg00306.php
>
> As best I can tell the objections came from the fact that Thomas had
> implemented it as a postmaster-start-time switch, which made it a
> foot-gun because you could mistakenly start the postmaster with a
> different XLOG than you were using before. That would not apply to a
> symlink-made-by-initdb approach. All this is doing is formalizing
> something we already suggest people do by hand...

Right. Thomas decided he didn't want to adjust the patch based on
community input, so the patch was removed. It was one of the few cases
where I had to back out someone else's patch against their will.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Casey Duncan <casey(at)pandora(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Subject: Re: [PATCHES] xlog directory at initdb time
Date: 2007-01-02 19:43:54
Message-ID: F83D28A8-8BDE-4632-99B7-744BFFA7C0D7@pandora.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


On Jan 2, 2007, at 7:18 AM, Tom Lane wrote:

> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
>> Am Mittwoch, 27. Dezember 2006 02:56 schrieb Euler Taveira de
>> Oliveira:
>>> This simple patch lets someone specifies the xlog directory at
>>> initdb
>>> time. It uses symlinks to do it, and create and/or set
>>> permissions at
>>> the directory as appropriate.
>
>> We already had this functionality in initdb a few versions ago.
>> Did you
>> review why it was removed?
>
> The discussion thread seems to start here:
>
> http://archives.postgresql.org/pgsql-hackers/2002-08/msg00306.php
>
> As best I can tell the objections came from the fact that Thomas had
> implemented it as a postmaster-start-time switch, which made it a
> foot-gun because you could mistakenly start the postmaster with a
> different XLOG than you were using before. That would not apply to a
> symlink-made-by-initdb approach. All this is doing is formalizing
> something we already suggest people do by hand...

I guess the downside there is that it won't work on platforms that
don't support symlinks, whereas the postmaster switch would. Not that
I condone using such platforms ;^)

-Casey


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Casey Duncan <casey(at)pandora(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Subject: Re: [PATCHES] xlog directory at initdb time
Date: 2007-01-02 20:08:32
Message-ID: 10742.1167768512@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Casey Duncan <casey(at)pandora(dot)com> writes:
> I guess the downside there is that it won't work on platforms that
> don't support symlinks, whereas the postmaster switch would. Not that
> I condone using such platforms ;^)

Well, we already bit that bullet with respect to tablespaces, and
haven't gotten much of any pushback. So I don't see it as a problem
here.

regards, tom lane


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Casey Duncan <casey(at)pandora(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Subject: Re: [PATCHES] xlog directory at initdb time
Date: 2007-01-02 20:21:01
Message-ID: 20070102202101.GB6589@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Casey Duncan <casey(at)pandora(dot)com> writes:
> > I guess the downside there is that it won't work on platforms that
> > don't support symlinks, whereas the postmaster switch would. Not that
> > I condone using such platforms ;^)
>
> Well, we already bit that bullet with respect to tablespaces, and
> haven't gotten much of any pushback. So I don't see it as a problem
> here.

Note that if Casey is thinking that Win32 does not support symlinks, he
is wrong (we do support tablespaces there).

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: xlog directory at initdb time
Date: 2007-01-02 20:23:57
Message-ID: 200701022023.l02KNva28566@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

------------------------------------------------------------------------
Euler Taveira de Oliveira wrote:
> Hi,
> This simple patch lets someone specifies the xlog directory at initdb
> time. It uses symlinks to do it, and create and/or set permissions at
> the directory as appropriate.
>
> --
> Euler Taveira de Oliveira
> http://www.timbira.com/

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-patches(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org, Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Subject: Re: xlog directory at initdb time
Date: 2007-01-03 08:52:29
Message-ID: 200701030952.30220.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Am Mittwoch, 27. Dezember 2006 02:56 schrieb Euler Taveira de Oliveira:
> This simple patch lets someone specifies the xlog directory at initdb
> time. It uses symlinks to do it, and create and/or set permissions at
> the directory as appropriate.

On the name of the option, it's not actually a "data" directory, so I'd just
call it --xlogdir, parallel to --datadir.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: xlog directory at initdb time
Date: 2007-01-04 01:46:57
Message-ID: 20070104014657.GB3066@timbira.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Peter Eisentraut wrote:

> On the name of the option, it's not actually a "data" directory, so I'd just
> call it --xlogdir, parallel to --datadir.
>
Seems reasonable. Patch modified is attached.

--
Euler Taveira de Oliveira
http://www.timbira.com/

Attachment Content-Type Size
xlogdir.diff text/plain 8.4 KB

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] xlog directory at initdb time
Date: 2007-01-04 03:42:04
Message-ID: 200701040342.l043g4N10867@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

---------------------------------------------------------------------------

Euler Taveira de Oliveira wrote:
> Peter Eisentraut wrote:
>
> > On the name of the option, it's not actually a "data" directory, so I'd just
> > call it --xlogdir, parallel to --datadir.
> >
> Seems reasonable. Patch modified is attached.
>
>
> --
> Euler Taveira de Oliveira
> http://www.timbira.com/

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: xlog directory at initdb time
Date: 2007-01-06 19:40:06
Message-ID: 200701061940.l06Je6O15916@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


Patch applied. Thanks.

---------------------------------------------------------------------------

Euler Taveira de Oliveira wrote:
> Peter Eisentraut wrote:
>
> > On the name of the option, it's not actually a "data" directory, so I'd just
> > call it --xlogdir, parallel to --datadir.
> >
> Seems reasonable. Patch modified is attached.
>
>
> --
> Euler Taveira de Oliveira
> http://www.timbira.com/

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +