postgresql/src
Noah Misch e7f89a5dec 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 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 by Daniel Gustafsson and Kyotaro HORIGUCHI.

Discussion: https://postgr.es/m/20130911033341.GD225735@tornado.leadboat.com
2019-04-03 17:03:50 -07:00
..
backend Consistently test for in-use shared memory. 2019-04-03 17:03:50 -07:00
bin Have pg_upgrade's Makefile honor NO_TEMP_INSTALL 2019-03-31 08:22:23 -04:00
common Fix portability failure introduced in commits d2b0b60e7 et al. 2018-12-26 15:30:35 -05:00
include Consistently test for in-use shared memory. 2019-04-03 17:03:50 -07:00
interfaces Fix potential memory access violation in ecpg if filename of include file is 2019-03-11 16:17:17 +01:00
makefiles Move port-specific parts of with_temp_install to port makefile. 2019-02-04 19:00:18 +00:00
pl Translation updates 2019-02-11 14:15:25 +01:00
port Fix error handling of readdir() port implementation on first file lookup 2019-03-04 09:50:19 +09:00
template Yet further rethinking of build changes for macOS Mojave. 2018-11-02 18:54:00 -04:00
test Perform RLS subquery checks as the right user when going via a view. 2019-04-02 08:22:48 +01:00
timezone Update time zone data files to tzdata release 2018i. 2019-02-05 10:59:31 -05:00
tools Unify searchpath and do file logic in MSVC build scripts. 2019-02-06 07:55:10 -05:00
tutorial Remove no-longer-required function declarations. 2015-05-24 12:20:23 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
Makefile.global.in Move port-specific parts of with_temp_install to port makefile. 2019-02-04 19:00:18 +00:00
Makefile.shlib Ensure static libraries have correct mod time even if ranlib messes it up. 2018-11-29 15:53:44 -05:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00