postgresql/src/backend/storage/file
Alvaro Herrera fba105b109 Use "transient" files for blind writes, take 2
"Blind writes" are a mechanism to push buffers down to disk when
evicting them; since they may belong to different databases than the one
a backend is connected to, the backend does not necessarily have a
relation to link them to, and thus no way to blow them away.  We were
keeping those files open indefinitely, which would cause a problem if
the underlying table was deleted, because the operating system would not
be able to reclaim the disk space used by those files.

To fix, have bufmgr mark such files as transient to smgr; the lower
layer is allowed to close the file descriptor when the current
transaction ends.  We must be careful to have any other access of the
file to remove the transient markings, to prevent unnecessary expensive
system calls when evicting buffers belonging to our own database (which
files we're likely to require again soon.)

This commit fixes a bug in the previous one, which neglected to cleanly
handle the LRU ring that fd.c uses to manage open files, and caused an
unacceptable failure just before beta2 and was thus reverted.
2011-06-10 13:43:02 -04:00
..
buffile.c Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
copydir.c Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
fd.c Use "transient" files for blind writes, take 2 2011-06-10 13:43:02 -04:00
Makefile Support unlogged tables. 2010-12-29 06:48:53 -05:00
reinit.c pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00