Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7ef2b31

Browse files
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.com
1 parent0ba09cc commit7ef2b31

File tree

11 files changed

+525
-180
lines changed

11 files changed

+525
-180
lines changed

‎src/Makefile.global.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,13 +430,13 @@ ifeq ($(enable_tap_tests),yes)
430430
defineprove_installcheck
431431
rm -rf '$(CURDIR)'/tmp_check
432432
$(MKDIR_P) '$(CURDIR)'/tmp_check
433-
cd$(srcdir) && TESTDIR='$(CURDIR)' PATH="$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' top_builddir='$(CURDIR)/$(top_builddir)' PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress'$(PROVE)$(PG_PROVE_FLAGS)$(PROVE_FLAGS)$(if$(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
433+
cd$(srcdir) && TESTDIR='$(CURDIR)' PATH="$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' top_builddir='$(CURDIR)/$(top_builddir)' PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress'REGRESS_SHLIB='$(abs_top_builddir)/src/test/regress/regress$(DLSUFFIX)'$(PROVE)$(PG_PROVE_FLAGS)$(PROVE_FLAGS)$(if$(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
434434
endef
435435

436436
defineprove_check
437437
rm -rf '$(CURDIR)'/tmp_check
438438
$(MKDIR_P) '$(CURDIR)'/tmp_check
439-
cd$(srcdir) && TESTDIR='$(CURDIR)'$(with_temp_install) PGPORT='6$(DEF_PGPORT)' PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress'$(PROVE)$(PG_PROVE_FLAGS)$(PROVE_FLAGS)$(if$(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
439+
cd$(srcdir) && TESTDIR='$(CURDIR)'$(with_temp_install) PGPORT='6$(DEF_PGPORT)' PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress'REGRESS_SHLIB='$(abs_top_builddir)/src/test/regress/regress$(DLSUFFIX)'$(PROVE)$(PG_PROVE_FLAGS)$(PROVE_FLAGS)$(if$(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
440440
endef
441441

442442
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp