postgresql/src/backend/utils
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
..
adt Remove inadequate check for duplicate "xml" PI. 2019-03-23 17:40:19 -04:00
cache Fix a crash in logical replication 2019-01-30 11:16:27 +01:00
error Disallow setting client_min_messages higher than ERROR. 2018-11-08 17:33:26 -05:00
fmgr Add a utility function to extract variadic function arguments 2017-10-25 07:20:37 -04:00
hash Reorganize our CRC source files again. 2015-04-14 17:03:42 +03:00
init Consistently test for in-use shared memory. 2019-04-03 17:03:50 -07:00
mb Don't call pgwin32_message_to_UTF16() without CurrentMemoryContext. 2017-11-12 13:03:28 -08:00
misc Disallow NaN as a value for floating-point GUCs. 2019-03-10 12:58:52 -04:00
mmgr Handle elog(FATAL) during ROLLBACK more robustly. 2017-08-14 15:43:20 -04:00
resowner Update copyright for 2015 2015-01-06 11:43:47 -05:00
sort Fix actual and potential double-frees around tuplesort usage. 2018-03-28 13:26:43 -04:00
time Fix pruning of locked and updated tuples. 2017-12-14 18:20:48 -08:00
.gitignore Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
errcodes.txt Redesign tablesample method API, and do extensive code review. 2015-07-25 14:39:00 -04:00
Gen_dummy_probes.pl Remove dependency on psed for MSVC builds. 2016-03-19 18:44:04 -04:00
Gen_dummy_probes.sed Update copyright for 2015 2015-01-06 11:43:47 -05:00
Gen_fmgrtab.pl Allow forcing nullness of columns during bootstrap. 2015-02-21 22:31:54 +01:00
generate-errcodes.pl Update copyright for 2015 2015-01-06 11:43:47 -05:00
Makefile Fix make rules that generate multiple output files. 2018-03-23 13:45:38 -04:00
probes.d Update copyright for 2015 2015-01-06 11:43:47 -05:00