forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7ef2b31
committed
Consistently test for in-use shared memory.
postmaster startup scrutinizes any shared memory segment recorded inpostmaster.pid, exiting if that segment matches the current datadirectory and has an attached process. When the postmaster.pid file wasmissing, a starting postmaster used weaker checks. Change to use thesame checks in both scenarios. This increases the chance of a startupfailure, in lieu of data corruption, if the DBA does "kill -9 `head -n1postmaster.pid` && rm postmaster.pid && pg_ctl -w start". A postmasterwill no longer stop if shmat() of an old segment fails with EACCES. Apostmaster will no longer recycle segments pertaining to other datadirectories. That's good for production, but it's bad for integrationtests 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. In9.6 and later, enhance PostgresNode to facilitate testing. Back-patchto 9.4 (all supported versions).Reviewed (in earlier versions) by Daniel Gustafsson and Kyotaro HORIGUCHI.Discussion:https://postgr.es/m/20190408064141.GA2016666@rfd.leadboat.com1 parent0ba09cc commit7ef2b31
File tree
11 files changed
+525
-180
lines changed- src
- backend
- port
- postmaster
- storage/ipc
- utils/init
- include/storage
- test
- perl
- recovery/t
- tools/msvc
11 files changed
+525
-180
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
430 | 430 |
| |
431 | 431 |
| |
432 | 432 |
| |
433 |
| - | |
| 433 | + | |
434 | 434 |
| |
435 | 435 |
| |
436 | 436 |
| |
437 | 437 |
| |
438 | 438 |
| |
439 |
| - | |
| 439 | + | |
440 | 440 |
| |
441 | 441 |
| |
442 | 442 |
| |
|
0 commit comments
Comments
(0)