Re: Deadlock possibility in _bt_check_unique? - Mailing list pgsql-hackers

From Gokulakannan Somasundaram
Subject Re: Deadlock possibility in _bt_check_unique?
Date
Msg-id 9362e74e1003231202ifd377f5o652778e61895019f@mail.gmail.com
Whole thread Raw
In response to Re: Deadlock possibility in _bt_check_unique?  (Gokulakannan Somasundaram <gokul007@gmail.com>)
List pgsql-hackers
Oh! yeah, i got it.  Thanks....

On Wed, Mar 24, 2010 at 12:26 AM, Gokulakannan Somasundaram <gokul007@gmail.com> wrote:

> T2 : session 1 releases the lock on p1 (its waiting to acquire a ex lock on
> p2)

That's not what we do.  See _bt_findinsertloc.

                       regards, tom lane

      I am really confused. Please keep the cool and explain me, if i am wrong. I could see this code in _bt_findinsertloc. There is a _bt_relandgetbuf, which releases lock on p1 and tries to acquire a lock on p2. I wrote ex lock in the place of BT_WRITE.

00589         for (;;)
00590 {
00591 BlockNumber rblkno = lpageop->btpo_next;
00592
00593 rbuf = _bt_relandgetbuf(rel, rbuf, rblkno, BT_WRITE);
00594 page = BufferGetPage(rbuf);
00595 lpageop = (BTPageOpaque) PageGetSpecialPointer(page);
00596 if (!P_IGNORE(lpageop))
00597 break;
00598 if (P_RIGHTMOST(lpageop))
00599 elog(ERROR, "fell off the end of index \"%s\"",
00600 RelationGetRelationName(rel));
00601 }



What is that, i am missing here?

Gokul.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Proposal: access control jails (and introduction as aspiring GSoC student)
Next
From: Tom Lane
Date:
Subject: Re: Deadlock possibility in _bt_check_unique?