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: 2004-08-26 20:28:08
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCE475B3D@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32


>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

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Robert Treat 2004-08-26 21:18:42 Re: [pgsql-hackers-win32] Win32 release warning
Previous Message Darcy Buskermolen 2004-08-26 20:20:51 Re: [pgsql-hackers-win32] Win32 release warning