postgresql/src/include/storage
Tom Lane e81e8f9342 Split up process latch initialization for more-fail-soft behavior.
In the previous coding, new backend processes would attempt to create their
self-pipe during the OwnLatch call in InitProcess.  However, pipe creation
could fail if the kernel is short of resources; and the system does not
recover gracefully from a FATAL error right there, since we have armed the
dead-man switch for this process and not yet set up the on_shmem_exit
callback that would disarm it.  The postmaster then forces an unnecessary
database-wide crash and restart, as reported by Sean Chittenden.

There are various ways we could rearrange the code to fix this, but the
simplest and sanest seems to be to split out creation of the self-pipe into
a new function InitializeLatchSupport, which must be called from a place
where failure is allowed.  For most processes that gets called in
InitProcess or InitAuxiliaryProcess, but processes that don't call either
but still use latches need their own calls.

Back-patch to 9.1, which has only a part of the latch logic that 9.2 and
HEAD have, but nonetheless includes this bug.
2012-10-14 22:59:56 -04:00
..
backendid.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
barrier.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
block.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
buf.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
buf_internals.h Scan the buffer pool just once, not once per fork, during relation drop. 2012-06-07 17:43:11 -04:00
buffile.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
bufmgr.h Scan the buffer pool just once, not once per fork, during relation drop. 2012-06-07 17:43:11 -04:00
bufpage.h Replace XLogRecPtr struct with a 64-bit integer. 2012-06-24 19:19:45 +03:00
copydir.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
fd.h Inherit max_safe_fds to child processes in EXEC_BACKEND mode. 2012-03-29 08:19:11 +03:00
freespace.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
fsm_internals.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
indexfsm.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
ipc.h Unify calling conventions for postgres/postmaster sub-main functions 2012-06-25 21:30:12 +03:00
item.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
itemid.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
itemptr.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
large_object.h Remove unnecessary overhead in backend's large-object operations. 2012-10-09 16:38:00 -04:00
latch.h Split up process latch initialization for more-fail-soft behavior. 2012-10-14 22:59:56 -04:00
lmgr.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
lock.h Add a small cache of locks owned by a resource owner in ResourceOwner. 2012-06-21 15:30:26 +03:00
lwlock.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
off.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
pg_sema.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
pg_shmem.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
pmsignal.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
pos.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
predicate.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
predicate_internals.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
proc.h Introduce timeout handling framework 2012-07-16 22:55:33 -04:00
procarray.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
procsignal.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
reinit.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
relfilenode.h Improve coding around the fsync request queue. 2012-07-17 16:56:54 -04:00
s_lock.h When LWLOCK_STATS is defined, count spindelays. 2012-06-26 16:06:07 -04:00
shmem.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
sinval.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
sinvaladt.h Tighten up includes in sinvaladt.h, twophase.h, proc.h 2012-06-25 18:40:40 -04:00
smgr.h Improve coding around the fsync request queue. 2012-07-17 16:56:54 -04:00
spin.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
standby.h Introduce timeout handling framework 2012-07-16 22:55:33 -04:00