Re: Race condition in pg_database_size()

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Race condition in pg_database_size()
Date: 2007-03-10 22:36:43
Message-ID: 20070310223643.GA93317@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Mar 10, 2007 at 12:32:04PM -0500, Tom Lane wrote:
> Michael Fuhr <mike(at)fuhr(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-03-10 22:39:37 Re: Race condition in pg_database_size()
Previous Message Simon Riggs 2007-03-10 22:10:51 Re: [PATCHES] scan_recycle_buffers