Skip site navigation (1) Skip section navigation (2)

Re: BUG #3245: PANIC: failed to re-find shared loc k o b j ect

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Dorochevsky,Michel" <michel(dot)dorochevsky(at)softcon(dot)de>, pgsql-bugs(at)postgresql(dot)org, Dave Page <dpage(at)postgresql(dot)org>
Subject: Re: BUG #3245: PANIC: failed to re-find shared loc k o b j ect
Date: 2007-04-23 21:22:04
Message-ID: 462D237C.2000101@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackerspgsql-patches
Tom Lane wrote:
> Heikki Linnakangas <heikki(at)enterprisedb(dot)com> writes:
>> Locking the same lock twice is usually handled correctly, I don't 
>> understand why it fails in this case. I'm thinking that the locallock 
>> structs somehow get out of sync with the lock structs in shared memory. 
>> The twophase-records are created from the locallock structs alone, so if 
>> there's extra entries in the locallocks table for some reason, we'd get 
>> the symptoms we have.
> 
> Hmm.  I was just noticing this comment in PostPrepare_Locks:
> 
>      * We do this separately because we may have multiple locallock entries
>      * pointing to the same proclock, and we daren't end up with any dangling
>      * pointers.
> 
> I'm not clear at the moment on why such a state would exist, but could
> it be related?

That caught my eye as well. I'm not sure what the other alternative 
would be, that might leave dangling pointers. The comment seems to be 
copy-pasted from LockReleaseAll.

>> Unless you have a better idea, I'd like to add some more debug-prints to 
>> AtPrepare_Locks to see what gets written to the state file and why.
> 
> Seems like a reasonable thing to pursue.

Dave, would you please create a new binary with the attached patch? And 
LOCK_DEBUG and assertions and debug enabled.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Attachment: atprepare-debug.patch
Description: text/x-diff (1.3 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Josh BerkusDate: 2007-04-23 21:23:29
Subject: Re: RETURN QUERY in PL/PgSQL?
Previous:From: Neil ConwayDate: 2007-04-23 21:17:00
Subject: RETURN QUERY in PL/PgSQL?

pgsql-bugs by date

Next:From: Tom LaneDate: 2007-04-23 21:26:48
Subject: Re: BUG #3245: PANIC: failed to re-find shared loc k o b j ect
Previous:From: William LawranceDate: 2007-04-23 21:02:04
Subject: Re: BUG #3244: problem with PREPARE

pgsql-patches by date

Next:From: Tom LaneDate: 2007-04-23 21:26:48
Subject: Re: BUG #3245: PANIC: failed to re-find shared loc k o b j ect
Previous:From: Tom LaneDate: 2007-04-23 19:47:20
Subject: Re: BUG #3245: PANIC: failed to re-find shared loc k o b j ect

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group