Re: [HACKERS] Why copy_relation_data only use wal whenWALarchivingis enabled

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Patches" <pgsql-patches(at)postgresql(dot)org>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Simon Riggs" <simon(at)2ndquadrant(dot)com>, "Jacky Leng" <lengjianquan(at)163(dot)com>
Subject: Re: [HACKERS] Why copy_relation_data only use wal whenWALarchivingis enabled
Date: 2007-10-20 14:14:26
Message-ID: 471A0D42.1020507@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Here's an updated version of the patch. There was a bogus assertion in
the previous one, comparing against mdsync_cycle_ctr instead of
mdunlink_cycle_ctr.

Heikki Linnakangas wrote:
> Tom Lane wrote:
>> Heikki Linnakangas <heikki(at)enterprisedb(dot)com> writes:
>>> The best I can think of is to rename the obsolete file to
>>> <relfilenode>.stale, when it's scheduled for deletion at next
>>> checkpoint, and check for .stale-suffixed files in GetNewRelFileNode,
>>> and delete them immediately in DropTableSpace.
>> This is getting too Rube Goldbergian for my tastes. What if we just
>> make DROP TABLESPACE force a checkpoint before proceeding?
>
> Patch attached.
>
> The scenario we're preventing is still possible if for some reason the
> latest checkpoint record is damaged, and we start recovery from the
> previous checkpoint record. I think the probability of that happening,
> together with the OID wrap-around and hitting the relfilenode of a
> recently deleted file with a new one, is low enough to not worry about.
> If we cared, we could fix it by letting the files to linger for two
> checkpoint cycles instead of one.

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

Attachment Content-Type Size
avoid-premature-relfilenode-reuse-2.patch text/x-diff 13.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Trevor Talbot 2007-10-20 16:40:20 Re: 8.2.3: Server crashes on Windows using Eclipse/Junit
Previous Message Rainer Bauer 2007-10-20 11:22:56 Re: 8.2.3: Server crashes on Windows using Eclipse/Junit

Browse pgsql-patches by date

  From Date Subject
Next Message Luke Lonergan 2007-10-20 17:19:43 Re: Including Snapshot Info with Indexes
Previous Message Martijn van Oosterhout 2007-10-20 08:30:43 Re: Including Snapshot Info with Indexes