From:
Alfred Perlstein <bright(at)wintelcom(dot)net>
To:
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc:
Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>, Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>,
pgsql-hackers(at)postgresql(dot)org
Subject:
Re: How to shoot yourself in the foot: kill -9 postmaster
Date:
2001-03-06 19:12:16
Message-ID:
20010306111216.P8663@fw.wintelcom.net (view raw or flat )
Thread:
2001-03-05 22:30:26 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-05 23:19:34 from Thomas Swan <tswan-lst(at)ics(dot)olemiss(dot)edu>
2001-03-05 23:47:51 from Alfred Perlstein <bright(at)wintelcom(dot)net>
2001-03-06 01:46:41 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 01:49:01 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 01:52:40 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2001-03-06 01:52:13 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2001-03-06 01:55:41 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 02:11:38 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 02:14:16 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2001-03-06 02:23:55 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 02:36:28 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 02:45:08 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 02:53:05 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 03:03:49 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 03:10:18 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 03:24:11 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 03:31:05 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 02:57:56 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2001-03-06 03:06:41 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 03:08:26 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2001-03-06 03:11:56 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 17:04:44 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2001-03-06 17:55:54 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 18:20:40 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2001-03-06 19:07:32 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 16:57:48 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2001-03-06 16:54:49 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2001-03-06 02:19:25 from ncm(at)zembu(dot)com (Nathan Myers)
2001-03-06 02:33:19 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 02:19:33 from Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
2001-03-06 02:28:20 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 02:36:56 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 02:40:41 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 02:55:11 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 03:04:47 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 03:12:00 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 03:17:36 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 03:27:23 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 03:33:49 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 03:44:36 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 12:30:06 from dom(at)idealx(dot)com
2001-03-06 05:43:13 from Alfred Perlstein <bright(at)wintelcom(dot)net>
2001-03-06 18:10:47 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 18:22:46 from Alfred Perlstein <bright(at)wintelcom(dot)net>
2001-03-06 18:35:24 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 18:44:47 from Alfred Perlstein <bright(at)wintelcom(dot)net>
2001-03-06 18:57:04 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 19:12:16 from Alfred Perlstein <bright(at)wintelcom(dot)net>
2001-03-06 19:24:54 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 19:34:32 from Alfred Perlstein <bright(at)wintelcom(dot)net>
2001-03-07 00:04:20 from Cyril VELTER <cyril(dot)velter(at)libertysurf(dot)fr>
2001-03-07 00:22:10 from Alfred Perlstein <bright(at)wintelcom(dot)net>
2001-03-06 19:19:12 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2001-03-06 19:27:12 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 19:49:45 from Alfred Perlstein <bright(at)wintelcom(dot)net>
2001-03-06 19:36:26 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 19:54:44 from Alfred Perlstein <bright(at)wintelcom(dot)net>
2001-03-06 20:20:59 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2001-03-06 20:46:24 from ncm(at)zembu(dot)com (Nathan Myers)
2001-03-06 21:20:13 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 22:43:05 from Alfred Perlstein <bright(at)wintelcom(dot)net>
2001-03-07 00:29:41 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-07 00:58:16 from ncm(at)zembu(dot)com (Nathan Myers)
2001-03-07 01:16:18 from Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
2001-03-06 21:56:25 from Samuel Sieb <samuel(at)sieb(dot)net>
2001-03-06 22:01:48 from "Martin A(dot) Marques" <martin(at)math(dot)unl(dot)edu(dot)ar>
2001-03-08 16:43:16 from teg(at)redhat(dot)com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=)
2001-03-07 01:50:52 from teg(at)redhat(dot)com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=)
2001-03-07 04:38:36 from "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
Lists:
pgsql-hackers
* Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> [010306 11:03] wrote:
> Alfred Perlstein <bright(at)wintelcom(dot)net> writes:
> >> Are there any portability problems with relying on shm_nattch to be
> >> available? If not, I like this a lot...
>
> > Well it's available on FreeBSD and Solaris, I'm sure Redhat has
> > some deamon that resets the value to 0 periodically just for kicks
> > so it might not be viable... :)
>
> I notice that our BeOS and QNX emulations of shmctl() don't support
> IPC_STAT, but that could be dealt with, at least to the extent of
> stubbing it out.
Well since we already have spinlocks, I can't see why we can't
keep the refcount and spinlock in a special place in the shm
for all cases?
> This does raise the question of what to do if shmctl(IPC_STAT) fails
> for a reason other than EINVAL. I think the conservative thing to do
> is refuse to start up. On EPERM, for example, it's possible that there
> is a postmaster running in your PGDATA but with a different userid.
Yes, if possible a more meaningfull error message and pointer to
some docco would be nice or even a nice "i don't care, i killed
all the backends, just start darnit" flag, it's really no fun at
all to have to attempt to decypher some cryptic error message at
3am when the database/system is acting up. :)
> > Seriously, there's some dispute on the type that 'shm_nattch' is,
> > under Solaris it's "shmatt_t" (unsigned long afaik), under FreeBSD
> > it's 'short' (i should fix this. :)).
>
> > But since you're really only testing for 0'ness then it shouldn't
> > really be a problem.
>
> We need not copy the value anywhere, so as long as the struct is
> correctly declared in the system header files I don't think it matters
> what the field type is ...
Yup, my point exactly.
--
-Alfred Perlstein - [bright(at)wintelcom(dot)net|alfred(at)freebsd(dot)org]
In response to
Responses
pgsql-hackers by date
Next :From: Peter EisentrautDate: 2001-03-06 19:19:12
Subject : Re: How to shoot yourself in the foot: kill -9 postmaster
Previous :From : Lamar OwenDate : 2001-03-06 19:07:32
Subject : Re: How to shoot yourself in the foot: kill -9 postmaster