Re: postmaster.pid
- From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
- To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Joerg Hessdoerfer" <Joerg(dot)Hessdoerfer(at)sea-gmbh(dot)com>
- Cc: "Andrew Dunstan" <andrew(at)dunslane(dot)net>, <pgsql-hackers-win32(at)postgresql(dot)org>
- Subject: Re: postmaster.pid
- Date: Thu, 26 Aug 2004 22:28:08 +0200
- Message-id: <6BCB9D8A16AC4241919521715F4D8BCE475B3D(at)algol(dot)sollentuna(dot)se>
>I've occasionally thought about abandoning the PID test, in favor of
>relying completely on the shmem-existence test. If the shmem segment
>named in the lockfile doesn't exist or has zero processes connected to
>it, we could safely assume that the original postmaster is gone.
>(If it has processes connected, we must abort anyway, to cover the case
>where the postmaster crashed but backends remain alive.) The risk here
>is that we are then *completely* at the mercy of the OS having
>a correct
>emulation of the SysV shmem semantics, in particular the ability to
>detect whether a shmem segment has other processes connected to it.
>I'm not sure whether this is true on all the supported platforms.
>(This being the win32 list: what about Windows?)
You can try to attach to a segment if it exists. Or create a new one. It
goes away automatically when the last process referring it goes away.
(we're just doing named mmap of the pagefile). Not sure if the shmem
emualation is 100% complete on that, but it sure can be made so.
//Magnus
Home |
Main Index |
Thread Index