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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers pgsql-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 Content-Type Size
atprepare-debug.patch text/x-diff 1.3 KB

In response to

Responses

Browse pgsql-bugs by date

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

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2007-04-23 21:23:29 Re: RETURN QUERY in PL/PgSQL?
Previous Message Neil Conway 2007-04-23 21:17:00 RETURN QUERY in PL/PgSQL?

Browse pgsql-patches by date

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