Re: DROP DATABASE vs patch to not remove files right away

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: DROP DATABASE vs patch to not remove files right away
Date: 2008-04-17 19:28:04
Message-ID: 4807A4C4.4050601@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Heikki Linnakangas <heikki(at)enterprisedb(dot)com> writes:
>> Tom Lane wrote:
>>> ISTM that we must fix the bgwriter so that ForgetDatabaseFsyncRequests
>>> causes PendingUnlinkEntrys for the doomed DB to be thrown away too.
>
>> Because of the asynchronous nature of ForgetDatabaseFsyncRequests, this
>> still isn't enough, I'm afraid.
>
> Hm. I notice that there is no bug on Windows because dropdb forces a
> checkpoint before it starts to remove files. Maybe the sanest solution
> is to just do that on all platforms.

Yeah, I don't see any other simple solution.

Patch attached that does the three changes we've talked about:'
- make ForgetDatabaseFsyncRequests forget unlink requests as well
- make rmtree() not fail on ENOENT
- force checkpoint on in dropdb on all platforms

plus some comment changes reflecting what we now know. I will apply this
tomorrow if there's no objections.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Attachment Content-Type Size
pendingunlink-fix-6.patch text/x-diff 5.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2008-04-17 19:48:27 Re: Patch for Prevent pg_dump/pg_restore from being affected by statement_timeout
Previous Message Bruce Momjian 2008-04-17 19:24:09 Re: RFD: hexstring(n) data type