forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6d81e3c
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 parente7e71b9 commit6d81e3c
File tree
11 files changed
+524
-179
lines changed- src
- backend
- port
- postmaster
- storage/ipc
- utils/init
- include/storage
- test
- perl
- recovery/t
- tools/msvc
11 files changed
+524
-179
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
383 | 383 |
| |
384 | 384 |
| |
385 | 385 |
| |
386 |
| - | |
| 386 | + | |
387 | 387 |
| |
388 | 388 |
| |
389 | 389 |
| |
390 | 390 |
| |
391 |
| - | |
| 391 | + | |
392 | 392 |
| |
393 | 393 |
| |
394 | 394 |
| |
|
0 commit comments
Comments
(0)