Re: Reducing some DDL Locks to ShareLock

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reducing some DDL Locks to ShareLock
Date: 2008-11-10 00:11:21
Message-ID: 1226275881.27904.281.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Sun, 2008-11-09 at 17:12 -0500, Tom Lane wrote:

> Reviewing away ...

Thanks for reviewing.

> There's a fairly serious problem...

...

> Any thoughts about the best way to do it? My immediate inclination is
> to use heap_lock_tuple but it's a bit expensive.

Not sure how non-transactional tuple locking would/could work.

The user space solution to this problem is optimistic locking. i.e.
re-read the row immediately prior to the update. If row has changed,
keep re-reading it until it stays same, then update. Rely on block
locking to protect us. I'm tired and handwaving a lot.

Will think some more and report back.

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Decibel! 2008-11-10 00:12:21 Re: [WIP] In-place upgrade
Previous Message Vladimir Sitnikov 2008-11-10 00:01:04 Re: Windowing Function Patch Review -> ROW_NUMBER without ORDER BY