pgsql: Shift the responsibility for emitting "database system is shut d - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Shift the responsibility for emitting "database system is shut d
Date
Msg-id E1aTwhJ-0002aq-2t@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Shift the responsibility for emitting "database system is shut down".

Historically this message has been emitted at the end of ShutdownXLOG().
That's not an insane place for it in a standalone backend, but in the
postmaster environment we've grown a fair amount of stuff that happens
later, including archiver/walsender shutdown, stats collector shutdown,
etc.  Recent buildfarm experimentation showed that on slower machines
there could be many seconds' delay between finishing ShutdownXLOG() and
actual postmaster exit.  That's fairly confusing, both for testing
purposes and for DBAs.  Hence, move the code that prints this message
into UnlinkLockFiles(), so that it comes out just after we remove the
postmaster's pidfile.  That is a more appropriate definition of "is shut
down" from the point of view of "pg_ctl stop", for example.  In general,
removing the pidfile should be the last externally-visible action of
either a postmaster or a standalone backend; compare commit
d73d14c271653dff10c349738df79ea03b85236c for instance.  So this seems
like a reasonably future-proof approach.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d18643c4a6d5ac41b012abc5d11fb5a7ccddf6c5

Modified Files
--------------
src/backend/access/transam/xlog.c |  4 ----
src/backend/utils/init/miscinit.c | 11 +++++++++++
2 files changed, 11 insertions(+), 4 deletions(-)


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Use separate lwlock tranches for buffer, lock, and predicate loc
Next
From: Tom Lane
Date:
Subject: pgsql: Fix typo in comment.