postgresql/src/backend/storage/ipc
Tom Lane d1cbd26ded Repair two places where SIGTERM exit could leave shared memory state
corrupted.  (Neither is very important if SIGTERM is used to shut down the
whole database cluster together, but there's a problem if someone tries to
SIGTERM individual backends.)  To do this, introduce new infrastructure
macros PG_ENSURE_ERROR_CLEANUP/PG_END_ENSURE_ERROR_CLEANUP that take care
of transiently pushing an on_shmem_exit cleanup hook.  Also use this method
for createdb cleanup --- that wasn't a shared-memory-corruption problem,
but SIGTERM abort of createdb could leave orphaned files lying around.

Backpatch as far as 8.2.  The shmem corruption cases don't exist in 8.1,
and the createdb usage doesn't seem important enough to risk backpatching
further.
2008-04-16 23:59:40 +00:00
..
ipc.c Repair two places where SIGTERM exit could leave shared memory state 2008-04-16 23:59:40 +00:00
ipci.c Modify interactions between sinval.c and sinvaladt.c. The code that actually 2008-03-16 19:47:34 +00:00
Makefile Refactor backend makefiles to remove lots of duplicate code 2008-02-19 10:30:09 +00:00
pmsignal.c Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
procarray.c Rename snapmgmt.c/h to snapmgr.c/h, for consistency with other files. 2008-03-26 18:48:59 +00:00
README Make source code READMEs more consistent. Add CVS tags to all README files. 2008-03-20 17:55:15 +00:00
shmem.c Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
shmqueue.c Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
sinval.c Move ProcState definition into sinvaladt.c from sinvaladt.h, since it's not 2008-03-17 11:50:27 +00:00
sinvaladt.c Move elog(DEBUG4) call outside the locked area, per suggestion from Tom Lane. 2008-03-18 12:36:43 +00:00

$PostgreSQL: pgsql/src/backend/storage/ipc/README,v 1.5 2008/03/20 17:55:15 momjian Exp $

Cache Invalidation Synchronization Routines
===========================================

Mon Jul 18 11:09:22 PDT 1988  W.KLAS

The cache synchronization is done using a message queue. Every
backend can register a message which then has to be read by
all backends. A message read by all backends is removed from the 
queue automatically. If a message has been lost because the buffer
was full, all backends that haven't read this message will be
told that they have to reset their cache state. This is done
at the time when they try to read the message queue.

The message queue is implemented as a shared buffer segment. Actually,
the queue is a circle to allow fast inserting, reading (invalidate data) and
maintaining the buffer.