postgresql/src
Heikki Linnakangas 9cb91f90c9 Fix two race conditions between the pending unlink mechanism that was put in
place to prevent reusing relation OIDs before next checkpoint, and DROP
DATABASE. First, if a database was dropped, bgwriter would still try to unlink
the files that the rmtree() call by the DROP DATABASE command has already
deleted, or is just about to delete. Second, if a database is dropped, and
another database is created with the same OID, bgwriter would in the worst
case delete a relation in the new database that happened to get the same OID
as a dropped relation in the old database.

To fix these race conditions:
- make rmtree() ignore ENOENT errors. This fixes the 1st race condition.
- make ForgetDatabaseFsyncRequests forget unlink requests as well.
- force checkpoint on in dropdb on all platforms

Since ForgetDatabaseFsyncRequests() is asynchronous, the 2nd change isn't
enough on its own to fix the problem of dropping and creating a database with
same OID, but forcing a checkpoint on DROP DATABASE makes it sufficient.

Per Tom Lane's bug report and proposal. Backpatch to 8.3.
2008-04-18 06:48:38 +00:00
..
backend Fix two race conditions between the pending unlink mechanism that was put in 2008-04-18 06:48:38 +00:00
bin Fix comment typo. 2008-04-16 18:18:00 +00:00
include Cause EXPLAIN's VERBOSE option to print the target list (output column list) 2008-04-18 01:42:17 +00:00
interfaces Avoid using unnecessary pgwin32_safestat in libpq. 2008-04-16 14:19:56 +00:00
makefiles Implement a few changes to how shared libraries and dynamically loadable 2008-04-07 14:15:58 +00:00
pl Clean up a few places where Datums were being treated as pointers (and vice 2008-04-17 21:37:28 +00:00
port Fix two race conditions between the pending unlink mechanism that was put in 2008-04-18 06:48:38 +00:00
template Use SYSV semaphores rather than POSIX on Darwin >= 6.0 (i.e., OS X 10.2 2007-09-26 00:32:46 +00:00
test Replace "amgetmulti" AM functions with "amgetbitmap", in which the whole 2008-04-10 22:25:26 +00:00
timezone More README src cleanups. 2008-03-21 13:23:29 +00:00
tools Ignore blank lines in typedef file. 2008-04-16 21:03:08 +00:00
tutorial Implement a few changes to how shared libraries and dynamically loadable 2008-04-07 14:15:58 +00:00
DEVELOPERS Testing commit stuff 2006-07-10 15:50:02 +00:00
Makefile Catch all errors in for and while loops in makefiles. Don't ignore any 2008-03-18 16:24:50 +00:00
Makefile.global.in Upgrade to Autoconf 2.61: 2008-02-17 16:36:43 +00:00
Makefile.shlib On cygwin and win32, don't override the shlib name when building a module. 2008-04-08 09:50:29 +00:00
bcc32.mak Remove old-style win32 client-only visual c++ build infrastructure for everything except 2007-03-05 14:18:38 +00:00
nls-global.mk When merging PO files, take into consideration translations in other PO 2006-04-05 13:40:15 +00:00
win32.mak Update supported standalone VC++ version to 7.1+ only, and fix 2007-08-03 10:47:11 +00:00