Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9IHgZP99587 for ; Thu, 18 Oct 2001 13:42:35 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id f9IHg8c24639; Thu, 18 Oct 2001 13:42:08 -0400 (EDT) To: Allan Engelhardt cc: pgsql-admin@postgresql.org Subject: Re: Automatically starting postmaster after system crash In-reply-to: <3BCDDBF5.9050204@cybaea.com> References: <26865.1003330212@sss.pgh.pa.us> <3BCDDBF5.9050204@cybaea.com> Comments: In-reply-to Allan Engelhardt message dated "Wed, 17 Oct 2001 20:28:53 +0100" Date: Thu, 18 Oct 2001 13:42:08 -0400 Message-ID: <24636.1003426928@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200110/177 X-Sequence-Number: 2421 Allan Engelhardt writes: > Tom Lane wrote: >> That's kinda hard to believe; how would a shared memory segment survive >> a system crash? > I don't think they can. Some options: > (1) PostgreSQL keeps a reference to it somewhere and can get confused... Indeed, there is a reference to the old segment in the postmaster.pid file. At startup, if there's a postmaster.pid file, Postgres checks to see that the indicated shared memory segment is gone or at least has no processes attached to it. (This is a defense against the possibility that the old postmaster died but there are still backends running in the database.) Evidently, that check is mistakenly thinking that there *is* still a shmem seg with attached processes. Question is why? > Seriously: I tried to reproduce using SysRq+S, SysRq+B and couldn't. I > think I have seen enough fsck for one night, so I might give it a rest... You might try just kill -9'ing the postmaster, rather than physically rebooting your system. regards, tom lane