Re: Advisory locks seem rather broken - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Advisory locks seem rather broken
Date
Msg-id 3258.1336137937@sss.pgh.pa.us
Whole thread Raw
In response to Re: Advisory locks seem rather broken  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Advisory locks seem rather broken
List pgsql-hackers
Robert Haas <robertmhaas@gmail.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


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Advisory locks seem rather broken
Next
From: Tom Lane
Date:
Subject: Re: JSON in 9.2 - Could we have just one to_json() function instead of two separate versions ?