Re: Advisory locks seem rather broken

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org, Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
Subject: Re: Advisory locks seem rather broken
Date: 2012-05-04 13:25:37
Message-ID: 3258.1336137937@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> In 9.1, we just did this:

> if (locallock->proclock == NULL || locallock->lock == NULL)
> {
> /*
> * We must've run out of shared memory while
> trying to set up this
> * lock. Just forget the local entry.
> */
> Assert(locallock->nLocks == 0);
> RemoveLocalLock(locallock);
> continue;
> }

> ...and I just shoved the new logic into that stanza without thinking
> hard enough about what order to do things in.

Right. The other thing that was bothering me about that was that it's
not clear now how to tell a broken locallock entry (which is what this
logic originally intended to clean up) from a fastpath one. Perhaps
it'd be a good idea to add a "valid" flag? And while I'm wondering
about such things, what happens when it's necessary to convert a
fastpath lock to a regular one, but there's no room in shared memory
for more lock objects?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-05-04 13:52:45 Re: JSON in 9.2 - Could we have just one to_json() function instead of two separate versions ?
Previous Message Robert Haas 2012-05-04 13:17:28 Re: Advisory locks seem rather broken