Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VdGsg-0000Jd-6S for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Nov 2013 09:55:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VdGsf-00047I-Hq for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Nov 2013 09:55:33 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VdGse-00047A-Lc for pgsql-hackers@postgresql.org; Mon, 04 Nov 2013 09:55:32 +0000 Received: from moutng.kundenserver.de ([212.227.17.9]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VdGsb-0007rA-DU for pgsql-hackers@postgresql.org; Mon, 04 Nov 2013 09:55:32 +0000 Received: from anarazel.de (p5DDC6D42.dip0.t-ipconnect.de [93.220.109.66]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0LoIFV-1WA8ix0LY9-00grPN; Mon, 04 Nov 2013 10:55:22 +0100 Received: by anarazel.de (Postfix, from userid 1000) id 28BCE100AA1; Mon, 4 Nov 2013 10:55:21 +0100 (CET) Date: Mon, 4 Nov 2013 10:55:21 +0100 From: Andres Freund To: Heikki Linnakangas Cc: Noah Misch , Robert Haas , Tom Lane , Andrew Dunstan , "pgsql-hackers@postgresql.org" Subject: Re: Something fishy happening on frogmouth Message-ID: <20131104095521.GI3567@awork2.anarazel.de> References: <527223E8.2020207@vmware.com> <20131031095021.GA31628@alap2.anarazel.de> <22875.1383229757@sss.pgh.pa.us> <5272EC6A.2020004@vmware.com> <20131101162230.GA649568@tornado.leadboat.com> <52775A83.7090206@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52775A83.7090206@vmware.com> X-Provags-ID: V02:K0:hxzBDdHYYlrNOMx8vQJF0gZNGCNrYJK+wRPl8j5t1XD cth5ALWbEbVXshA7NfV+In/ZBGEgMYw/OnzWNZdqHvjWOZLLJs PoEO8wfYQo5dO/YIcjZOY+W13Axktk0kjibHJzoR6vTrIXye9x uZ4geaIEyZuF9c2s17xk9kP6mdiycEEMhj2tAw293s796VQV8X aDRu9mdRiNWCydxeVZrn5IK+Gm3ryi3XvnoW4hP7F5eeI2DiIT I8/N7pmBu0o9QUZmiDLHrPHZB8av/Y7vCVGmyKzIZ8If0Bm4lC qXL36ytbHqsF7A139Ugp1PruTk4y6hMHv352cY+wCMkXyIE2FP BCzQUKuCNDw7VV1W0Jr0gxZIS7jSETdfMR1pMrVid X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 2013-11-04 10:27:47 +0200, Heikki Linnakangas wrote: > On 01.11.2013 18:22, Noah Misch wrote: > >On Fri, Nov 01, 2013 at 12:27:31AM -0400, Robert Haas wrote: > >>On Thu, Oct 31, 2013 at 7:48 PM, Heikki Linnakangas wrote: > >>>On 31.10.2013 16:43, Robert Haas wrote: > >>>>There should be no cases where the main shared memory > >>>>segment gets cleaned up and the dynamic shared memory segments do not. > >>> > >>>1. initdb -D data1 > >>>2. initdb -D data2 > >>>3. postgres -D data1 > >>>4. killall -9 postgres > >>>5. postgres -D data2 > >>> > >>>The system V shmem segment orphaned at step 4 will be cleaned up at step 5. > >>>The DSM segment will not. > > > >Note that dynamic_shared_memory_type='mmap' will give the desired behavior. Well, with the significant price of causing file-io. > Hmm, here's another idea: > > Postmaster creates the POSIX shared memory object at startup, by calling > shm_open(), and immediately calls shm_unlink on it. That way, once all the > processes have exited, the object will be removed automatically. Child > processes inherit the file descriptor at fork(), and don't need to call > shm_open, just mmap(). Uh. Won't that completely and utterly remove the point of dsm which is that you can create segments *after* startup? We surely don't want to start overallocating enough shmem so we don't ever dynamically need to allocate segments. Also, I don't think it's portable across platforms to access segments that already have been unlinked. I think this is looking for a solution without an actually relevant problem disregarding the actual problem space. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers