Re: File leak? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: File leak?
Date
Msg-id 11898.1087170442@sss.pgh.pa.us
Whole thread Raw
In response to Re: File leak?  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: File leak?
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> (viz, log at the instant of file creation, and the replayer would have
>> to keep track of whether it sees the creating transaction commit and
>> delete the file if not).

> I don't see how we could WAL log it because we don't fsync the WAL until
> our transaction completes, right, or are you thinking we would do a
> special fsync when we add the record?

Right, we would have to XLogFlush the file-creation WAL record before we
could actually create the file.  This is in line with the standard WAL
rule: the WAL record must hit disk before the data file change it
describes does.  Assuming that the filesystem fsync's the created inode
immediately, that means we have to flush first.

I'm not sure what the performance implications of this would be; it's
likely that pushing the cost somewhere else would be better.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: File leak?
Next
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] Configuration patch