Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 00B392E0076 for ; Thu, 29 May 2008 02:49:21 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 14255-01 for ; Thu, 29 May 2008 02:48:58 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.244]) by developer.postgresql.org (Postfix) with ESMTP id B30B52E00B1 for ; Thu, 29 May 2008 02:14:13 -0300 (ADT) Received: by an-out-0708.google.com with SMTP id d30so41143and.33 for ; Wed, 28 May 2008 22:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=QLhz9lIu/tR/rOpIqLzESXt4NCBbHLyeNL1wUj0mYss=; b=mzv4g/op+FVkBeyz38LyXsXAmVKnmEudNNjzbx9/IdF9Wht0BYCozSAfMAh8/bGV7EYlrRhTF8BR15dgh8VPfd7qtxXl+hIO6xENRmgankrErDAQfPIv8aNq79nwyytEZrrnGCZ2/xbFmcKvv4mHDui/t+NyVqaBVN+Amj7YTPg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=q+O1pqwtaTtgHanMpfdHvbbPDxdKvTfngCZ8uJABx/eYEAJkpwJhJdpOau/21X9xTfCAk5JCLcf3GYY6n6NOTjsWd9DG+o1NnMM+fGHa3kV7l5THbif3B1w8NdZzES+u6YAr6i8wCTGV7dkYlx/TFdEjyfdhW8nbe4M3Tcs4vac= Received: by 10.100.41.1 with SMTP id o1mr5546168ano.10.1212038052632; Wed, 28 May 2008 22:14:12 -0700 (PDT) Received: by 10.100.250.18 with HTTP; Wed, 28 May 2008 22:14:12 -0700 (PDT) Message-ID: <8078a1730805282214l32d4833j50ccb6c5bb177c9a@mail.gmail.com> Date: Wed, 28 May 2008 22:14:12 -0700 From: "Medi Montaseri" To: "Tom Lane" Subject: Re: what happend to my database Cc: "Steve Holdoway" , pgsql-admin@postgresql.org In-Reply-To: <13918.1212029485@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_9775_3804398.1212038052624" References: <8078a1730805281837y1ed331bey4e7db16a63423cfa@mail.gmail.com> <20080529135235.d6fcad87.steve.holdoway@firetrust.com> <13918.1212029485@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/236 X-Sequence-Number: 29320 ------=_Part_9775_3804398.1212038052624 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Yes, this type of presumptuous behavior to wipe out a production database based on a few checks is too risky... Behavior one: First out-of-box time, pg_ctl does not find any database files, it tells the user that "sorry I did not find any database to start....see initdb.... Result: we have a semi-unhappy user/admin that says... what is initdb Behavior two: In order to enhance the out-of-box experience, we have wiped out a production environment, leading to many unhappy staff and customers.... PG developers...I am not impressed at all... Medi On Wed, May 28, 2008 at 7:51 PM, Tom Lane wrote: > Steve Holdoway writes: > > "Medi Montaseri" wrote: > >> I think the following happend... > >> Since my PGDATA was on an iSCSI device, by the time > /etc/rc3.d/S64postgresql > >> was executed, the device below it was not available.....question...why > the > >> error says "permission denied" vs "file not found". In the meantime, > pg_ctl > >> kept trying and finally concluded that the data directory is blank, and > >> hence this must be a out-of-box case and he is good to initdb the PGDATA > and > >> as it called initdb to do the job... the iSCSI volume below it came > online > >> and by then the bomb had already been dropped. > >> > >> Now I need to find some facts to support this... > > When you mount a partition on linux, it does this by overlaying it's root > directory with the existing one on the parent volume. Ownerships and > permissions are also replaced. I expect that the /qmsvol directory will be > owned by root, with fairly restrictive access rights. This will not be the > case the root ( . ) directory on the external device, which will be > postgres-friendly. > >> Where else can I look for forensics > > I don't think you need any more! To fix this, I'd do 2 things. First, > start postgres much later in the boot sequence: > > cd /etc/rc3.d ; mv S64postgresql S99postgresql > > ( and the same in rc5.d if you're using a gui at all ). > > The other thing to do is remove the auto-initdb behavior in your startup > script. We've done that in recent releases because of prior reports of > this type of problem. The OP's script is evidently still old-school, > though. > > regards, tom lane > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin > ------=_Part_9775_3804398.1212038052624 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Yes, this type of presumptuous behavior to wipe out a production database based on a few checks is too risky...

Behavior one:
First out-of-box time, pg_ctl does not find any database files, it tells the user that "sorry I did not find any database to start....see initdb....
Result: we have a semi-unhappy user/admin that says... what is initdb

Behavior two:
In order to enhance the out-of-box experience, we have wiped out a production environment, leading to many unhappy staff and customers....

PG developers...I am not impressed at all...

Medi



On Wed, May 28, 2008 at 7:51 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Steve Holdoway <steve.holdoway@firetrust.com> writes:
> "Medi Montaseri" <montaseri@gmail.com> wrote:
>> I think the following happend...
>> Since my PGDATA was on an iSCSI device, by the time /etc/rc3.d/S64postgresql
>> was executed, the device below it was not available.....question...why the
>> error says "permission denied" vs "file not found".  In the meantime, pg_ctl
>> kept trying and finally concluded that the data directory is blank, and
>> hence this must be a out-of-box case and he is good to initdb the PGDATA and
>> as it called initdb to do the job... the iSCSI volume below it came online
>> and by then the bomb had already been dropped.
>>
>> Now I need to find some facts to support this...
> When you mount a partition on linux, it does this by overlaying it's root directory with the existing one on the parent volume. Ownerships and permissions are also replaced. I expect that the /qmsvol directory will be owned by root, with fairly restrictive access rights. This will not be the case the root ( . ) directory on the external device, which will be postgres-friendly.
>> Where else can I look for forensics
> I don't think you need any more! To fix this, I'd do 2 things. First, start postgres much later in the boot sequence:
>   cd /etc/rc3.d ; mv S64postgresql S99postgresql
> ( and the same in rc5.d if you're using a gui at all ).

The other thing to do is remove the auto-initdb behavior in your startup
script.  We've done that in recent releases because of prior reports of
this type of problem.  The OP's script is evidently still old-school,
though.

                       regards, tom lane

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

------=_Part_9775_3804398.1212038052624--