From aae7ff0df859b7b8996e73384579fe6ee5f64621 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 12 Apr 2007 15:04:47 +0000 Subject: [PATCH] Cancel pending fsync requests during WAL replay of DROP DATABASE, per bug report from David Darville. Back-patch as far as 8.1, which may or may not have the problem but it seems a safe change anyway. --- src/backend/commands/dbcommands.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index ca67be8207..c9ecaa281c 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -1375,6 +1375,12 @@ dbase_redo(XLogRecPtr lsn, XLogRecord *record) */ DropBuffers(xlrec->db_id); + /* Also, clean out any entries in the shared free space map */ + FreeSpaceMapForgetDatabase(xlrec->db_id); + + /* Also, clean out any fsync requests that might be pending in md.c */ + ForgetDatabaseFsyncRequests(xlrec->db_id); + if (!rmtree(dst_path, true)) ereport(WARNING, (errmsg("could not remove database directory \"%s\"", -- 2.39.5