Re: could not create directory "...": File exists - Mailing list pgsql-hackers

From Tom Lane
Subject Re: could not create directory "...": File exists
Date
Msg-id 8246.1358550724@sss.pgh.pa.us
Whole thread Raw
In response to Re: could not create directory "...": File exists  (Stephen Frost <sfrost@snowman.net>)
Responses Re: could not create directory "...": File exists
List pgsql-hackers
Stephen Frost <sfrost@snowman.net> writes:
> Tom,
> * Tom Lane (tgl@sss.pgh.pa.us) wrote:
>> Don't see what.  The main reason we've not yet attempted a global fix is
>> that the most straightforward way (take a new snapshot each time we
>> start a new SnapshotNow scan) seems too expensive.  But CREATE DATABASE
>> is so expensive that the cost of an extra snapshot there ain't gonna
>> matter.

>   Patch attached.  Passes the regression tests and our internal testing
>   shows that it eliminates the error we were seeing (and doesn't cause
>   blocking, which is even better).

I committed this with a couple of changes:

* I used GetLatestSnapshot rather than GetTransactionSnapshot.  Since
we don't allow these operations inside transaction blocks, there
shouldn't be much difference, but in principle GetTransactionSnapshot
is the wrong thing; in a serializable transaction it could be quite old.

* After reviewing the other uses of SnapshotNow in dbcommands.c, I
decided we'd better make the same type of change in remove_dbtablespaces
and check_db_file_conflict, because those are likewise doing filesystem
operations on the strength of what they find in pg_tablespace.

I also ended up deciding to back-patch to 8.3 as well.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Boszormenyi Zoltan
Date:
Subject: Re: Contrib PROGRAM problem
Next
From: Phil Sorber
Date:
Subject: Re: My first patch! (to \df output)