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-24 11:51:34
Message-ID: 462DEF46.9000302@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackerspgsql-patches
Tom Lane wrote:
> It looks to me like the problem is that AtPrepare_Locks invokes
> LockTagIsTemp, and that goes and reads various system catalogs, which
> can result in new entries in the LOCALLOCK hash table, which might
> result in a bucket split in same, which would result in some entries
> possibly being scanned twice by the hash_seq_search scan.
> 
> Not sure about good fix, except that AtPrepare is probably a really 
> bad time to be doing fresh catalog searches.

Yep.

A simple fix would be to do the scan in two phases, searching for temp 
tables in the first phase, and writing the 2PC records in the second. 
We'd still be doing the catalog searches in the 1st phase, and might 
therefore split buckets and see some entries twice, but it wouldn't lead 
to duplicate 2PC records.

> Also, we have a generic issue that making fresh entries in a hashtable
> might result in a concurrent hash_seq_search scan visiting existing
> entries more than once; that's definitely not something any of the
> existing callers are thinking about.

Ouch. Note that we can also miss some entries altogether, which is 
probably even worse.

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

In response to

Responses

pgsql-hackers by date

Next:From: Magnus HaganderDate: 2007-04-24 12:26:02
Subject: Re: BUG #3242: FATAL: could not unlock semaphore: error code 298
Previous:From: Marko KreenDate: 2007-04-24 10:49:56
Subject: Re: Fragmentation project

pgsql-bugs by date

Next:From: Magnus HaganderDate: 2007-04-24 12:26:02
Subject: Re: BUG #3242: FATAL: could not unlock semaphore: error code 298
Previous:From: Simon KDate: 2007-04-24 09:56:06
Subject: BUG #3250: Different ResultSets btw JDBC Driver and pgAdmin3

pgsql-patches by date

Next:From: Heikki LinnakangasDate: 2007-04-24 12:50:17
Subject: Re: BUG #3245: PANIC: failed to re-find shared loc k o b j ect
Previous:From: Zeugswetter Andreas ADI SDDate: 2007-04-24 08:08:44
Subject: Re: [HACKERS] Full page writes improvement, code update

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