Re: FATAL: lock AccessShareLock on object 0/1260/0 is already held - Mailing list pgsql-hackers

From Robert Haas
Subject Re: FATAL: lock AccessShareLock on object 0/1260/0 is already held
Date
Msg-id CA+TgmoZySJcokj4ywqoAcxqgQ1dwqemBqi-Xe871K-MBt3R8ZA@mail.gmail.com
Whole thread Raw
In response to Re: FATAL: lock AccessShareLock on object 0/1260/0 is already held  (daveg <daveg@sonic.net>)
Responses Re: FATAL: lock AccessShareLock on object 0/1260/0 is already held
List pgsql-hackers
On Wed, Sep 7, 2011 at 4:22 PM, daveg <daveg@sonic.net> wrote:
> Yes, we make extensive use of advisory locks. That was my thought too when
> Robert mentioned session level locks.
>
> I'm happy to add any additional instrumentation, but my client would be
> happier to actually run it if there was a way to recover from this without
> an unplanned outage. Is there something I can do when the patch detects the
> problem to be able to continue without a restart?

Well, basically, you want to do the same thing that LockRelease()
would do - remove the PROCLOCK from the SHM_QUEUE and delete it from
the hash table, adjusting the counts in the LOCK object as
appropriate.  If you just ignore the failure, you'll get the "blah
blah blah is already held" messages you were having before.

Tom's right to be skeptical of my theory, because it would require a
CHECK_FOR_INTERRUPTS() outside of a transaction block in one of the
pathways that use session-level locks, and I can't find one.

OTOH, I'm skeptical of the theory that this involves userlocks,
because this whole thread started because of a complaint about lock
0/1260/0 already being held.  That ain't no userlock.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: daveg
Date:
Subject: Re: FATAL: lock AccessShareLock on object 0/1260/0 is already held
Next
From: Robert Haas
Date:
Subject: Re: [PATCH] Log crashed backend's query (activity string)