postgresql/src/backend/storage
Noah Misch 7ef2b313e6 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:36:42 -07:00
..
buffer Remove dubious micro-optimization in ckpt_buforder_comparator(). 2018-01-10 15:50:54 -05:00
file Tolerate EINVAL when calling fsync() on a directory. 2019-02-24 23:51:54 +13:00
freespace Avoid using potentially-under-aligned page buffers. 2018-09-01 15:27:13 -04:00
ipc Consistently test for in-use shared memory. 2019-04-12 22:36:42 -07:00
large_object Update copyright for 2018 2018-01-02 23:30:12 -05:00
lmgr Fix the initialization of atomic variables introduced by the 2018-11-13 11:09:44 +05:30
page Revert "Allow on-line enabling and disabling of data checksums" 2018-04-09 19:03:42 +02:00
smgr Track unowned relations in doubly-linked list 2019-03-27 03:18:54 +01:00
Makefile Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00