From owner-freebsd-stable@FreeBSD.ORG Mon May 2 21:29:27 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6A9BA16A4CE for ; Mon, 2 May 2005 21:29:27 +0000 (GMT) Received: from smtp806.mail.sc5.yahoo.com (smtp806.mail.sc5.yahoo.com [66.163.168.185]) by mx1.FreeBSD.org (Postfix) with SMTP id 2907A43D5E for ; Mon, 2 May 2005 21:29:27 +0000 (GMT) (envelope-from noackjr@alumni.rice.edu) Received: from unknown (HELO optimator.noacks.org) (noacks@swbell.net@70.240.205.64 with login) by smtp806.mail.sc5.yahoo.com with SMTP; 2 May 2005 21:29:26 -0000 Received: from localhost (localhost [127.0.0.1]) by optimator.noacks.org (Postfix) with ESMTP id B9882610A; Mon, 2 May 2005 16:29:25 -0500 (CDT) Received: from optimator.noacks.org ([127.0.0.1]) by localhost (optimator.noacks.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 08413-05; Mon, 2 May 2005 16:29:24 -0500 (CDT) Received: from [127.0.0.1] (optimator [192.168.1.11]) by optimator.noacks.org (Postfix) with ESMTP id 0EF0760D2; Mon, 2 May 2005 16:29:24 -0500 (CDT) Message-ID: <42769BB3.1050509@alumni.rice.edu> Date: Mon, 02 May 2005 16:29:23 -0500 From: Jonathan Noack User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Marc G. Fournier" References: <426E5713.3010906@eurocom.od.ua> <747dc8f30504260812ee3c47e@mail.gmail.com> <426E5EA5.8000703@eurocom.od.ua> <426F3AFA.9020900@konvergencia.hu> <426F5A6E.4050208@eurocom.od.ua> <86acndmyky.fsf@xps.des.no> <4276910A.3040100@criticalmagic.com> <20050502180152.I53065@ganymede.hub.org> In-Reply-To: <20050502180152.I53065@ganymede.hub.org> X-Enigmail-Version: 0.91.0.0 OpenPGP: id=991D8195; url=http://www.noacks.org/cert/noackjr.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigF8602D63DF47EB192E3F8BDD" X-Virus-Scanned: amavisd-new at noacks.org cc: =?ISO-8859-1?Q?Dag-Erli?= =?ISO-8859-1?Q?ng_Sm=F8rgrav?= cc: Richard Coleman cc: freebsd-stable@freebsd.org cc: Alexander Rusinov Subject: Re: PostgreSQL in FreeBSD jails X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: noackjr@alumni.rice.edu List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2005 21:29:27 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF8602D63DF47EB192E3F8BDD Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable On 5/2/2005 4:03 PM, Marc G. Fournier wrote: > yOn Mon, 2 May 2005, Richard Coleman wrote: >> Dag-Erling Sm=F8rgrav wrote: >>> There are two possible solutions: >>> >>> - hack the SysV IPC code to use separate namespaces for each jail >>> >>> - make PostgreSQL use POSIX shared memory instead of SysV shared >>> memory >>> >>> I suspect that the latter is significantly easier, and would probably= >>> improve performance as well. >>> >>> DES >> >> It might be easier to hack PostgreSQL so that the shared memory=20 >> identifier depends not only on the port, but also on the IP address=20 >> (which will of course be different for each jail). Or better yet, to = >> be able to specify the shared memory identifier to use directly in the= =20 >> config file. >=20 > You've all lost me here ... what exactly is the problem? PostgreSQL=20 > works under FreeBSD 4.x jails without any modifications, so how is=20 > PostgreSQL itself currently broken? It seems to me that the problem is= =20 > with FreeBSD 5.x's jail side of things, if the same daemon runs fine=20 > under 4.x, but, nto under 5.x ... From my reading on this thread: PostgreSQL generates the shared memory identifier based on the port it=20 is running on, but (on 5.x at least) shared memory is not segregated=20 between jails. Thus, a new instance will corrupt the shared memory of=20 another instance (in another jail, on another IP address, etc.) *if*=20 they are running on the same port. The workaround is to ensure every=20 instance (regardless of jail or IP address) is running on a unique port. --=20 Jonathan Noack | noackjr@alumni.rice.edu | OpenPGP: 0x991D8195 --------------enigF8602D63DF47EB192E3F8BDD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (MingW32) iD8DBQFCdpuzUFz01pkdgZURAiAUAJ9V3OQnGBQb1S5qM6t2UPBdswRpdwCfcXoN HFm10lNix5rqSgxyKNVQzKI= =OJEI -----END PGP SIGNATURE----- --------------enigF8602D63DF47EB192E3F8BDD--