CREATE DATABASE/DROP DATABASE race conditions

From: Florian Weimer <Weimer(at)CERT(dot)Uni-Stuttgart(dot)DE>
To: pgsql-bugs(at)postgresql(dot)org
Subject: CREATE DATABASE/DROP DATABASE race conditions
Date: 2002-07-14 14:18:52
Message-ID: 87r8i6jstv.fsf@CERT.Uni-Stuttgart.DE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)CERT(dot)Uni-Stuttgart(dot)DE
University of Stuttgart http://CERT.Uni-Stuttgart.DE/people/fw/
RUS-CERT fax +49-711-685-5898

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2002-07-14 17:13:32 Re: CREATE DATABASE/DROP DATABASE race conditions
Previous Message Tom Lane 2002-07-13 19:27:27 Re: It is a bug in pred_test()! (Was: [SQL] Please, HELP! Why is the query plan so wrong???)