Re: Time limit for a process to hold Content lock in Buffer Cache

From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila(at)huawei(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Time limit for a process to hold Content lock in Buffer Cache
Date: 2013-05-23 11:26:40
Message-ID: CC9C31E4-EB9C-4B59-8A11-4738ABA55AF9@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sent from my iPad

On 23-May-2013, at 16:27, Amit Kapila <amit(dot)kapila(at)huawei(dot)com> wrote:

> On Thursday, May 23, 2013 3:35 PM Atri Sharma wrote:
>> Hi all,
>>
>> I was searching for an existing mechanism which ensures that a crashed
>> process releases a content lock held on a page in buffer cache. Also,
>> a similar mechanism for refcount of the page.
>>
>> I seem to have missed it. Do we have a mechanism,and if yes,where can I
>> find it?
>
> On any process (backend, bgwriter,checkpointer, ..) crash, it reinitialize
> the shared memory which will clear any locks held.
> Please refer functions HandleChildCrash() and PostmasterStateMachine().
>
>

Thanks a ton.

On a different note, shouldn't we have a time out for a content lock in buffer cache? There is a limit to the time any sane process would want to hold a lock,especially when many tasks can be accomplish with only pinning the page.

I am just musing here,but it seems that we could potentially analyse this.I may be completely wrong.

Regards,

Atri

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-05-23 11:55:33 Re: pg_rewind, a tool for resynchronizing an old master after failover
Previous Message Heikki Linnakangas 2013-05-23 11:10:08 pg_rewind, a tool for resynchronizing an old master after failover