Re: Concurrent CREATE TABLE/DROP SCHEMA leaves inconsistent leftovers

From: Nikhil Sontakke <nikkhils(at)gmail(dot)com>
To: Nikhil Sontakke <nikhil(dot)sontakke(at)enterprisedb(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Concurrent CREATE TABLE/DROP SCHEMA leaves inconsistent leftovers
Date: 2011-11-10 12:00:17
Message-ID: CANgU5Zcyvt_Zx_MHt9V4va3JMqciBa6yQGE_R4JffdyBWBp1LQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> Ok, understood.
>
>
PFA, a patch against git head. We take the AccessShareLock lock on the
schema in DefineRelation now. Note that we do not want to interlock with
other concurrent creations in the schema. We only want to interlock with
deletion activity. So even performance wise this should not be much of an
overhead in case of concurrent DDL operations to the same schema.

Adding this in DefineRelation handles creation of
tables/views/types/sequences. I do not think we need to do stuff in ALTER
commands, because the objects pre-exist and this issue appears to be with
new objects only.

Comments?

Regards,
Nikhils

Attachment Content-Type Size
git_head_lock_schema_ddl.patch application/octet-stream 1.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-11-10 12:04:52 Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message
Previous Message Jan Kundrát 2011-11-10 11:46:36 Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message