Re:Connections hang indefinitely while taking a gin index's LWLock buffer_content lock

From: "chjischj(at)163(dot)com" <chjischj(at)163(dot)com>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, Andres Freund <andres(at)anarazel(dot)de>, Teodor Sigaev <teodor(at)sigaev(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re:Connections hang indefinitely while taking a gin index's LWLock buffer_content lock
Date: 2018-12-13 15:12:04
Message-ID: -xuw7yzpyit9uif44dbvzk65m-f549ez-gzj6jq-r0gfem-62ybwywoof3f9uii33-lpoemi-maz7teuvxwsvbw5svl-gqe71wlmm0a5x65knkv7athl6ksi8nnx4y4x-vrhan4xjky65z2xska-9zzj25.1544713924044@email.android.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body><div class="quote" style="line-height: 1.5"><aekorotkov(at)gmail(dot)com><x4mmm(at)yandex-team(dot)ru><pg(at)bowt(dot)ie><andres(at)anarazel(dot)de><chjischj(at)163(dot)com><teodor(at)sigaev(dot)ru><pgsql-hackers(at)lists(dot)postgresql(dot)org><br><div class="quote" style="line-height: 1.5">hi</div><div class="quote" style="line-height: 1.5">I Have a question. Why the order of unlocking is not adjusted in this patch? like this:</div><div class="quote" style="line-height: 1.5"><br></div><div class="quote" style="line-height: 1.5">if (BufferIsValid(lbuffer))</div><div class="quote" style="line-height: 1.5">UnlockReleaseBuffer(lbuffer);</div><div class="quote" style="line-height: 1.5">if (BufferIsValid(pbuffer))</div><div class="quote" style="line-height: 1.5">UnlockReleaseBuffer(pbuffer);</div><div class="quote" style="line-height: 1.5">if (BufferIsValid(dbuffer))</div><div class="quote" style="line-height: 1.5">UnlockReleaseBuffer(dbuffer);</div><div class="quote" style="line-height: 1.5">==&gt;</div><div class="quote" style="line-height: 1.5">if (BufferIsValid(pbuffer))</div><div class="quote" style="line-height: 1.5">UnlockReleaseBuffer(pbuffer);</div><div class="quote" style="line-height: 1.5">if (BufferIsValid(dbuffer))</div><div class="quote" style="line-height: 1.5">UnlockReleaseBuffer(dbuffer);</div><div class="quote" style="line-height: 1.5">if (BufferIsValid(lbuffer))</div><div class="quote" style="line-height: 1.5">UnlockReleaseBuffer(lbuffer);</div><div class="quote" style="line-height: 1.5"><br></div><br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, Dec 11, 2018 at 1:50 AM Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:<br>&gt; On Sun, Dec 9, 2018 at 10:25 PM Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:<br>&gt; &gt; On Sat, Dec 8, 2018 at 12:48 PM Andrey Borodin <x4mmm(at)yandex-team(dot)ru> wrote:<br>&gt; &gt; &gt; &gt; 8 дек. 2018 г., в 6:54, Alexander Korotkov <aekorotkov(at)gmail(dot)com> написал(а):<br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; Yep, please find attached draft patch.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Patch seems good to me, I'll check it in more detail.<br>&gt; &gt; &gt; The patch gets posting item at FirstOffsetNumber instead of btree-&gt;getLeftMostChild(). This seem OK, since dataGetLeftMostPage() is doing just the same, but with few Assert()s.<br>&gt; &gt;<br>&gt; &gt; I'd like to evade creating GinBtree for just calling<br>&gt; &gt; getLeftMostChild(). Also, few more places in ginvacuum.c do the same.<br>&gt; &gt; We have the same amount of Assert()s in ginVacuumPostingTreeLeaves().<br>&gt; &gt; So, let's keep it uniform.<br>&gt; &gt;<br>&gt; &gt; I would also like Peter Geoghegan to take a look at this patch before<br>&gt; &gt; committing it.<br>&gt;<br>&gt; I've slightly adjusted commit message. I'm going to commit this fix<br>&gt; if no objections.<br><br>Please also find patch changing lock order in ginRedoDeletePage()<br>preventing deadlock on standby. I'm going to commit it too.<br><br>------<br>Alexander Korotkov<br>Postgres Professional: http://www.postgrespro.com<br>The Russian Postgres Company</aekorotkov(at)gmail(dot)com></x4mmm(at)yandex-team(dot)ru></aekorotkov(at)gmail(dot)com></aekorotkov(at)gmail(dot)com></blockquote><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br></blockquote><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br></blockquote></pgsql-hackers(at)lists(dot)postgresql(dot)org></teodor(at)sigaev(dot)ru></chjischj(at)163(dot)com></andres(at)anarazel(dot)de></pg(at)bowt(dot)ie></x4mmm(at)yandex-team(dot)ru></aekorotkov(at)gmail(dot)com></div></body></html>

Attachment Content-Type Size
unknown_filename text/html 3.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2018-12-13 15:32:32 Re: Connections hang indefinitely while taking a gin index's LWLock buffer_content lock
Previous Message Tom Lane 2018-12-13 15:08:03 Re: 'infinity'::Interval should be added