Re: Deadlock possibility in _bt_check_unique?
От | Gokulakannan Somasundaram |
---|---|
Тема | Re: Deadlock possibility in _bt_check_unique? |
Дата | |
Msg-id | 9362e74e1003231156g2a0b8414gf57b26e209b869a0@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Deadlock possibility in _bt_check_unique? (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Deadlock possibility in _bt_check_unique?
(Gokulakannan Somasundaram <gokul007@gmail.com>)
Re: Deadlock possibility in _bt_check_unique? (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
<br /><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204,204, 204); padding-left: 1ex;"><div class="im"> > T2 : session 1 releases the lock on p1 (its waiting to acquirea ex lock on<br /> > p2)<br /><br /></div>That's not what we do. See _bt_findinsertloc.<br /><br /> regards, tom lane<br /></blockquote></div><br /> I am really confused. Please keep the cool and explainme, if i am wrong. I could see this code in _bt_findinsertloc. There is a _bt_relandgetbuf, which releases lock onp1 and tries to acquire a lock on p2. I wrote ex lock in the place of BT_WRITE.<br /><i><font size="2"><br style="font-family:arial,helvetica,sans-serif;" /></font></i><pre class="fragment"><i><font size="2"><span style="font-family:arial,helvetica,sans-serif;">00589 </span><span class="keywordflow" style="font-family: arial,helvetica,sans-serif;">for</span><spanstyle="font-family: arial,helvetica,sans-serif;"> (;;)</span><br style="font-family:arial,helvetica,sans-serif;" /> <a name="l00590" style="font-family: arial,helvetica,sans-serif;"></a><span style="font-family: arial,helvetica,sans-serif;">00590 {</span><br style="font-family: arial,helvetica,sans-serif;" /><a name="l00591"style="font-family: arial,helvetica,sans-serif;"></a><span style="font-family: arial,helvetica,sans-serif;">00591 </span><a class="code" href="http://doxygen.postgresql.org/block_8h.html#0be1c1ab88d7f8120e2cd2e8ac2697a1"style="font-family: arial,helvetica,sans-serif;">BlockNumber</a><spanstyle="font-family: arial,helvetica,sans-serif;"> rblkno = lpageop-></span><aclass="code" href="http://doxygen.postgresql.org/structBTPageOpaqueData.html#0e96302f6e2aa4203cef0e243362b692"style="font-family: arial,helvetica,sans-serif;">btpo_next</a><spanstyle="font-family: arial,helvetica,sans-serif;">;</span><br style="font-family:arial,helvetica,sans-serif;" /> <a name="l00592" style="font-family: arial,helvetica,sans-serif;"></a><span style="font-family: arial,helvetica,sans-serif;">00592</span><br style="font-family: arial,helvetica,sans-serif;" /><a name="l00593" style="font-family:arial,helvetica,sans-serif;"></a><span style="font-family: arial,helvetica,sans-serif;">00593 rbuf = </span><a class="code" href="http://doxygen.postgresql.org/nbtpage_8c.html#023261cd645fc5e8b4e8517fe9027bd6" style="font-family:arial,helvetica,sans-serif;">_bt_relandgetbuf</a><span style="font-family: arial,helvetica,sans-serif;">(rel,rbuf, rblkno, </span><a class="code" href="http://doxygen.postgresql.org/nbtree_8h.html#e494b1ec6ecbe7251dfc412a1ec53c1b"style="font-family: arial,helvetica,sans-serif;">BT_WRITE</a><spanstyle="font-family: arial,helvetica,sans-serif;">);</span><br style="font-family:arial,helvetica,sans-serif;" /> <a name="l00594" style="font-family: arial,helvetica,sans-serif;"></a><span style="font-family: arial,helvetica,sans-serif;">00594 page = </span><a class="code" href="http://doxygen.postgresql.org/bufmgr_8h.html#fb570c83a17839dabeb75dba7ea8e1a5"style="font-family: arial,helvetica,sans-serif;">BufferGetPage</a><spanstyle="font-family: arial,helvetica,sans-serif;">(rbuf);</span><br style="font-family:arial,helvetica,sans-serif;" /> <a name="l00595" style="font-family: arial,helvetica,sans-serif;"></a><span style="font-family: arial,helvetica,sans-serif;">00595 lpageop = (</span><a class="code" href="http://doxygen.postgresql.org/structBTPageOpaqueData.html"style="font-family: arial,helvetica,sans-serif;">BTPageOpaque</a><spanstyle="font-family: arial,helvetica,sans-serif;">) </span><a class="code"href="http://doxygen.postgresql.org/bufpage_8h.html#3be45495654ca1ff61f6ae45805e25f6" style="font-family: arial,helvetica,sans-serif;">PageGetSpecialPointer</a><spanstyle="font-family: arial,helvetica,sans-serif;">(page);</span><brstyle="font-family: arial,helvetica,sans-serif;" /> <a name="l00596" style="font-family: arial,helvetica,sans-serif;"></a><span style="font-family: arial,helvetica,sans-serif;">00596 </span><span class="keywordflow" style="font-family: arial,helvetica,sans-serif;">if</span><spanstyle="font-family: arial,helvetica,sans-serif;"> (!</span><a class="code" href="http://doxygen.postgresql.org/nbtree_8h.html#a8df35238449d00d7e14c3f1ccd3121c"style="font-family: arial,helvetica,sans-serif;">P_IGNORE</a><spanstyle="font-family: arial,helvetica,sans-serif;">(lpageop))</span><br style="font-family:arial,helvetica,sans-serif;" /> <a name="l00597" style="font-family: arial,helvetica,sans-serif;"></a><span style="font-family: arial,helvetica,sans-serif;">00597 </span><span class="keywordflow" style="font-family: arial,helvetica,sans-serif;">break</span><spanstyle="font-family: arial,helvetica,sans-serif;">;</span><br style="font-family:arial,helvetica,sans-serif;" /> <a name="l00598" style="font-family: arial,helvetica,sans-serif;"></a><span style="font-family: arial,helvetica,sans-serif;">00598 </span><span class="keywordflow" style="font-family: arial,helvetica,sans-serif;">if</span><spanstyle="font-family: arial,helvetica,sans-serif;"> (</span><a class="code" href="http://doxygen.postgresql.org/nbtree_8h.html#8b5e4857926b514c0f97592bf3344293"style="font-family: arial,helvetica,sans-serif;">P_RIGHTMOST</a><spanstyle="font-family: arial,helvetica,sans-serif;">(lpageop))</span><br style="font-family:arial,helvetica,sans-serif;" /> <a name="l00599" style="font-family: arial,helvetica,sans-serif;"></a><span style="font-family: arial,helvetica,sans-serif;">00599 </span><a class="code" href="http://doxygen.postgresql.org/elog_8h.html#850290250a1449fc513da20ae2ce5ec5"style="font-family: arial,helvetica,sans-serif;">elog</a><spanstyle="font-family: arial,helvetica,sans-serif;">(</span><a class="code" href="http://doxygen.postgresql.org/elog_8h.html#8fe83ac76edc595f6b98cd4a4127aed5"style="font-family: arial,helvetica,sans-serif;">ERROR</a><spanstyle="font-family: arial,helvetica,sans-serif;">, </span><span class="stringliteral"style="font-family: arial,helvetica,sans-serif;">"fell off the end of index \"%s\""</span><span style="font-family:arial,helvetica,sans-serif;">,</span><br style="font-family: arial,helvetica,sans-serif;" /> <a name="l00600" style="font-family: arial,helvetica,sans-serif;"></a><span style="font-family: arial,helvetica,sans-serif;">00600 </span><a class="code" href="http://doxygen.postgresql.org/rel_8h.html#5e9d450c92f70171110e22ffc678ed04"style="font-family: arial,helvetica,sans-serif;">RelationGetRelationName</a><spanstyle="font-family: arial,helvetica,sans-serif;">(rel));</span><brstyle="font-family: arial,helvetica,sans-serif;" /> <a name="l00601" style="font-family: arial,helvetica,sans-serif;"></a><span style="font-family: arial,helvetica,sans-serif;">00601 }</span></font></i><br /><br /><br /></pre>What is that, i am missing here?<br/><br />Gokul.<br />
В списке pgsql-hackers по дате отправления:
Следующее
От: Tom LaneДата:
Сообщение: Re: Proposal: access control jails (and introduction as aspiring GSoC student)