Re: Something fishy happening on frogmouth
Andres Freund <andres@2ndquadrant.com>
From: Andres Freund <andres@2ndquadrant.com>
To: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: Noah Misch <noah@leadboat.com>, Robert Haas <robertmhaas@gmail.com>,
Tom Lane <tgl@sss.pgh.pa.us>, Andrew Dunstan <andrew@dunslane.net>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2013-11-04T09:55:21Z
Lists: pgsql-hackers
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 <hlinnakangas@vmware.com> 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
Commits
-
Initialize random() in bootstrap/stand-alone postgres and in initdb.
- 402da7054f34 9.3.25 landed
- 401228183a63 9.4.20 landed
- d68d5adfdcae 9.5.15 landed
- 89f2b64da370 11.0 landed
- 4232cff11b84 10.6 landed
- 329cacb90270 9.6.11 landed
- d18f6674bd60 12.0 landed
-
Modify dynamic shared memory code to use Size rather than uint64.
- d2aecaea1555 9.4.0 cited