Re: [PATCH] Lazy xid assingment V2

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "August Zajonc" <augustz(at)augustz(dot)com>, "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>, "Postgresql-Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Lazy xid assingment V2
Date: 2007-09-01 18:12:30
Message-ID: 46D9AB8E.5010309@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> I had an idea this morning that might be useful: back off the strength
> of what we try to guarantee. Specifically, does it matter if we leak a
> file on crash, as long as it isn't occupying a lot of disk space?
> (I suppose if you had enough crashes to accumulate many thousands of
> leaked files, the directory entries would start to be a performance drag,
> but if your DB crashes that much you have other problems.) This leads
> to the idea that we don't really need to protect the open(O_CREAT) per
> se. Rather, we can emit a WAL entry *after* successful creation of a
> file, while it's still empty. This eliminates all the issues about
> logging an action that might fail. The WAL entry would need to include
> the relfilenode and the creating XID. Crash recovery would track these
> until it saw the commit or abort or prepare record for the XID, and if
> it didn't find any, would remove the file.

That idea, like all other approaches based on tracking WAL records, fail
if there's a checkpoint after the WAL record (and that's quite likely to
happen if the file is large). WAL replay wouldn't see the file creation
WAL entry, and wouldn't know to track the xid. We'd need a way to carry
the information over checkpoints.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ohp 2007-09-01 18:15:03 Re: Re: [COMMITTERS] pgsql: Fix brain fade in DefineIndex(): it was continuing to access the
Previous Message Tom Lane 2007-09-01 18:05:50 Re: Per-function search_path => per-function GUC settings