CREATE DATABASE/DROP DATABASE race conditions - Mailing list pgsql-bugs

From Florian Weimer
Subject CREATE DATABASE/DROP DATABASE race conditions
Date
Msg-id 87r8i6jstv.fsf@CERT.Uni-Stuttgart.DE
Whole thread Raw
Responses Re: CREATE DATABASE/DROP DATABASE race conditions
List pgsql-bugs
I'm observing weird behavior with CREATE DATABASE/DROP DATABASE and
PostgreSQL 7.2.1 (on Debian/unstable): There seems to be a short time
period after the 'Z' response of the backend during which the database
continues to exist (e.g. subsequent CREATE DATABASE operations with
the same name fail) or does not exist yet (e.g. it is not possible to
connect to the database).

You cannot reproduce this with "psql" or "createdb"/"dropdb".  In the
first case, the operations appear to be properly serialized, in the
second case, the process creation overhead prevents triggering this
race condition.  (I observe these with a test suite for a client
interface library.)

This might be a kernel or file system quirk (I'm using XFS 1.1).  Is
this a known issue, or shall I try to come up with a C test case?

--
Florian Weimer                       Weimer@CERT.Uni-Stuttgart.DE
University of Stuttgart           http://CERT.Uni-Stuttgart.DE/people/fw/
RUS-CERT                          fax +49-711-685-5898

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: It is a bug in pred_test()! (Was: [SQL] Please, HELP! Why is the query plan so wrong???)
Next
From: Tom Lane
Date:
Subject: Re: CREATE DATABASE/DROP DATABASE race conditions