Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 6CD0A2E3489 for ; Wed, 16 Jan 2008 13:33:44 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 68754-04 for ; Wed, 16 Jan 2008 13:33:34 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 0D02E2E383A for ; Wed, 16 Jan 2008 13:33:33 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id m0GHXWmK025482; Wed, 16 Jan 2008 12:33:32 -0500 (EST) To: Mischa Sandberg cc: pgsql-hackers@postgresql.org Subject: Re: postgresql in FreeBSD jails: proposal In-reply-to: <1200503603.478e3b33346ca@webmail.telus.net> References: <1200501702.478e33c61b74e@webmail.telus.net> <25135.1200503395@sss.pgh.pa.us> <1200503603.478e3b33346ca@webmail.telus.net> Comments: In-reply-to Mischa Sandberg message dated "Wed, 16 Jan 2008 09:13:23 -0800" Date: Wed, 16 Jan 2008 12:33:32 -0500 Message-ID: <25481.1200504812@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/664 X-Sequence-Number: 112938 Mischa Sandberg writes: > Quoting Tom Lane : >> Mischa Sandberg writes: >>> + if (kill(1,0) && errno == ESRCH && PGSharedMemoryIsInUse(0,NextShmemSegID)) >>> + continue; >> >> Isn't the last part of that test backward? If it isn't, I don't >> understand what it's for at all. > Serious blush here. Yes. Actually, after re-reading what PGSharedMemoryIsInUse does, I don't think you want to use it: it goes to considerable lengths to avoid returning a false positive, whereas in this context I believe we *do* need to avoid segments that belong to other data directories. So you probably need a separate chunk of code that only does the nattch test. regards, tom lane