postgresql/src/include/storage
Noah Misch c565de6431 Consistently test for in-use shared memory.
postmaster startup scrutinizes any shared memory segment recorded in
postmaster.pid, exiting if that segment matches the current data
directory and has an attached process.  When the postmaster.pid file was
missing, a starting postmaster used weaker checks.  Change to use the
same checks in both scenarios.  This increases the chance of a startup
failure, in lieu of data corruption, if the DBA does "kill -9 `head -n1
postmaster.pid` && rm postmaster.pid && pg_ctl -w start".  A postmaster
will no longer stop if shmat() of an old segment fails with EACCES.  A
postmaster will no longer recycle segments pertaining to other data
directories.  That's good for production, but it's bad for integration
tests that crash a postmaster and immediately delete its data directory.
Such a test now leaks a segment indefinitely.  No "make check-world"
test does that.  win32_shmem.c already avoided all these problems.  In
9.6 and later, enhance PostgresNode to facilitate testing.  Back-patch
to 9.4 (all supported versions).

Reviewed (in earlier versions) by Daniel Gustafsson and Kyotaro HORIGUCHI.

Discussion: https://postgr.es/m/20190408064141.GA2016666@rfd.leadboat.com
2019-04-12 22:41:42 -07:00
..
backendid.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
barrier.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
block.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
buf.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
buf_internals.h Fix failure to mark init buffers as BM_PERMANENT. 2017-03-14 12:03:29 -04:00
buffile.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
bufmgr.h Fix bug leading to restoring unlogged relations from empty files. 2015-12-10 16:39:25 +01:00
bufpage.h Fix PageAddItem BRIN bug 2016-05-30 14:47:22 -04:00
checksum.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
checksum_impl.h Make checksum_impl.h safe to compile with -fstrict-aliasing. 2018-08-31 12:27:07 -04:00
copydir.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
dsm.h Add flags argument to dsm_create. 2015-03-19 13:03:03 -04:00
dsm_impl.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
fd.h PANIC on fsync() failure. 2018-11-19 14:13:22 +13:00
freespace.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
fsm_internals.h Use FLEXIBLE_ARRAY_MEMBER in a bunch more places. 2015-02-20 00:11:42 -05:00
indexfsm.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
ipc.h Consistently test for in-use shared memory. 2019-04-12 22:41:42 -07:00
item.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
itemid.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
itemptr.h Improve packing/alignment annotation for ItemPointerData. 2015-05-21 17:21:46 -04:00
large_object.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
latch.h Don't CHECK_FOR_INTERRUPTS between WaitLatch and ResetLatch. 2016-08-01 15:13:53 -04:00
lmgr.h pgindent run for 9.5 2015-05-23 21:35:49 -04:00
lock.h Fix longstanding recursion hazard in sinval message processing. 2018-09-07 18:04:38 -04:00
lwlock.h Rework the way multixact truncations work. 2015-09-26 19:04:25 +02:00
off.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
pg_sema.h Remove the option to service interrupts during PGSemaphoreLock(). 2015-02-03 23:25:00 +01:00
pg_shmem.h Consistently test for in-use shared memory. 2019-04-12 22:41:42 -07:00
pmsignal.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
pos.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
predicate.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
predicate_internals.h Define integer limits independently from the system definitions. 2015-04-02 17:43:35 +02:00
proc.h Mark assorted variables PGDLLIMPORT. 2017-12-05 09:30:57 -05:00
procarray.h Preserve required !catalog tuples while computing initial decoding snapshot. 2017-04-27 13:13:37 -07:00
procsignal.h Prevent possibility of panics during shutdown checkpoint. 2017-06-05 19:18:16 -07:00
reinit.h reinit.h: Fix typo in identification comment 2015-01-22 12:26:51 -03:00
relfilenode.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
s_lock.h Add support for Motorola 88K to s_lock.h. 2017-11-20 17:57:46 -05:00
shm_mq.h Don't send protocol messages to a shm_mq that no longer exists. 2015-10-16 09:49:08 -04:00
shm_toc.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
shmem.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
sinval.h Introduce and use infrastructure for interrupt processing during client reads. 2015-02-03 22:25:20 +01:00
sinvaladt.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
smgr.h Track unowned relations in doubly-linked list 2019-03-27 03:20:57 +01:00
spin.h Remove cautions about using volatile from spin.h. 2015-10-16 14:10:28 -04:00
standby.h Use FLEXIBLE_ARRAY_MEMBER in a bunch more places. 2015-02-20 00:11:42 -05:00