]> granicus.if.org Git - postgresql/commit
Minor adjustments to make failures in startup/shutdown behave more cleanly.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 30 Nov 2006 18:29:12 +0000 (18:29 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 30 Nov 2006 18:29:12 +0000 (18:29 +0000)
commit5f60086e10a9b94642cebcc7633c282e4c921a24
tree432ed1f84b66c34a769aa2ad0d328c0de8b13f05
parentef148d6b8592e19cfeb9e2bee4255ddadc2ae3dd
Minor adjustments to make failures in startup/shutdown behave more cleanly.
StartupXLOG and ShutdownXLOG no longer need to be critical sections, because
in all contexts where they are invoked, elog(ERROR) would be translated to
elog(FATAL) anyway.  (One change in bgwriter.c is needed to make this true:
set ExitOnAnyError before trying to exit.  This is a good fix anyway since
the existing code would have gone into an infinite loop on elog(ERROR) during
shutdown.)  That avoids a misleading report of PANIC during semi-orderly
failures.  Modify the postmaster to include the startup process in the set of
processes that get SIGTERM when a fast shutdown is requested, and also fix it
to not try to restart the bgwriter if the bgwriter fails while trying to write
the shutdown checkpoint.  Net result is that "pg_ctl stop -m fast" does
something reasonable for a system in warm standby mode, and so should Unix
system shutdown (ie, universal SIGTERM).  Per gripe from Stephen Harris and
some corner-case testing of my own.
src/backend/access/transam/xlog.c
src/backend/postmaster/bgwriter.c
src/backend/postmaster/postmaster.c