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

2018-11-11 Thread chjis...@163.com
There's a mistake in the last mail.About how to reproduct the issue,the following SQL should be:set enable_seqscan = false;select count(*) from tb1 where id =1;4. execute select SQL    set enable_seqscan = false;    select count(*) from tb1 where id =2;Regard,Chen Huajun

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

2018-12-13 Thread chjis...@163.com
hiI Have a question. Why the order of unlocking is not adjusted in this patch? like this:if (BufferIsValid(lbuffer))UnlockReleaseBuffer(lbuffer);if (BufferIsValid(pbuffer))UnlockReleaseBuffer(pbuffer);if (BufferIsValid(dbuffer))UnlockReleaseBuffer(dbuffer);==>if (BufferIsValid(pbuffer))UnlockReleaseBuffer(pbuffer);if (BufferIsValid(dbuffer))UnlockReleaseBuffer(dbuffer);if (BufferIsValid(lbuffer))UnlockReleaseBuffer(lbuffer);On Tue, Dec 11, 2018 at 1:50 AM Alexander Korotkov  wrote:> On Sun, Dec 9, 2018 at 10:25 PM Alexander Korotkov  wrote:> > On Sat, Dec 8, 2018 at 12:48 PM Andrey Borodin  wrote:> > > > 8 дек. 2018 г., в 6:54, Alexander Korotkov  написал(а):> > > >> > > > Yep, please find attached draft patch.> > >> > > Patch seems good to me, I'll check it in more detail.> > > The patch gets posting item at FirstOffsetNumber instead of btree->getLeftMostChild(). This seem OK, since dataGetLeftMostPage() is doing just the same, but with few Assert()s.> >> > I'd like to evade creating GinBtree for just calling> > getLeftMostChild().  Also, few more places in ginvacuum.c do the same.> > We have the same amount of Assert()s in ginVacuumPostingTreeLeaves().> > So, let's keep it uniform.> >> > I would also like Peter Geoghegan to take a look at this patch before> > committing it.>> I've slightly adjusted commit message.  I'm going to commit this fix> if no objections.Please also find patch changing lock order in ginRedoDeletePage()preventing deadlock on standby.  I'm going to commit it too.--Alexander KorotkovPostgres Professional: http://www.postgrespro.comThe Russian Postgres Company