1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

Extend yesterday's patch so that the bgwriter is also told to forget

pending fsyncs during DROP DATABASE.  Obviously necessary in hindsight :-(
This commit is contained in:
Tom Lane
2007-01-17 16:25:01 +00:00
parent 530b10c719
commit eddbf39756
4 changed files with 125 additions and 56 deletions

View File

@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.189 2007/01/16 13:28:56 alvherre Exp $
* $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.190 2007/01/17 16:25:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -40,6 +40,7 @@
#include "postmaster/bgwriter.h"
#include "storage/freespace.h"
#include "storage/procarray.h"
#include "storage/smgr.h"
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/flatfiles.h"
@ -643,6 +644,12 @@ dropdb(const char *dbname, bool missing_ok)
*/
FreeSpaceMapForgetDatabase(db_id);
/*
* Tell bgwriter to forget any pending fsync requests for files in the
* database; else it'll fail at next checkpoint.
*/
ForgetDatabaseFsyncRequests(db_id);
/*
* On Windows, force a checkpoint so that the bgwriter doesn't hold any
* open files, which would cause rmdir() to fail.