Re: Race condition in pg_database_size() - Mailing list pgsql-hackers

From Michael Fuhr
Subject Re: Race condition in pg_database_size()
Date
Msg-id 20070310223643.GA93317@winnie.fuhr.org
Whole thread Raw
In response to Re: Race condition in pg_database_size()  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Race condition in pg_database_size()
List pgsql-hackers
On Sat, Mar 10, 2007 at 12:32:04PM -0500, Tom Lane wrote:
> Michael Fuhr <mike@fuhr.org> writes:
> > I'm wondering if the code should check for ENOENT if stat() fails
> > and either skip this entry silently under the assumption that the
> > file had been deleted since the call to ReadDir(),
> 
> Probably.  Want to look through the rest of that module for similar
> problems?

I think only db_dir_size() and calculate_tablespace_size() are
affected by this particular failure (ReadDir followed by stat).
I'll submit a patch -- any preferences for silent continuation vs.
continuation with a notice or warning?

-- 
Michael Fuhr


pgsql-hackers by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: [PATCHES] scan_recycle_buffers
Next
From: Tom Lane
Date:
Subject: Re: Race condition in pg_database_size()