Re: Parallel Index Scan vs BTP_DELETED and BTP_HALF_DEAD

2017-12-13 Thread Amit Kapila
On Thu, Dec 14, 2017 at 2:51 AM, Robert Haas wrote: > On Wed, Dec 13, 2017 at 12:35 AM, Kuntal Ghosh > wrote: >> I've also verified the backward scan case with the query provided by >> Thomas. In standby, >> 2. explain analyze select * from t1 where a+1>a order by a desc; and >> the parallel work

Re: Parallel Index Scan vs BTP_DELETED and BTP_HALF_DEAD

2017-12-13 Thread Robert Haas
On Wed, Dec 13, 2017 at 12:35 AM, Kuntal Ghosh wrote: > I've also verified the backward scan case with the query provided by > Thomas. In standby, > 2. explain analyze select * from t1 where a+1>a order by a desc; and > the parallel workers hang. > The patch fixes the issue. Committed and back-pa

Re: Parallel Index Scan vs BTP_DELETED and BTP_HALF_DEAD

2017-12-12 Thread Kuntal Ghosh
On Wed, Dec 13, 2017 at 10:33 AM, Kuntal Ghosh wrote: > On Tue, Dec 12, 2017 at 5:20 PM, Amit Kapila wrote: >> On Tue, Dec 12, 2017 at 4:00 PM, Kuntal Ghosh >> wrote: >>> On Mon, Dec 11, 2017 at 2:26 PM, Thomas Munro >>> wrote: On Mon, Dec 11, 2017 at 8:14 PM, Amit Kapila wrote: >>>

Re: Parallel Index Scan vs BTP_DELETED and BTP_HALF_DEAD

2017-12-12 Thread Kuntal Ghosh
On Tue, Dec 12, 2017 at 5:20 PM, Amit Kapila wrote: > On Tue, Dec 12, 2017 at 4:00 PM, Kuntal Ghosh > wrote: >> On Mon, Dec 11, 2017 at 2:26 PM, Thomas Munro >> wrote: >>> On Mon, Dec 11, 2017 at 8:14 PM, Amit Kapila >>> wrote: >>> Thanks for looking into it. I will see if we can write s

Re: Parallel Index Scan vs BTP_DELETED and BTP_HALF_DEAD

2017-12-12 Thread Thomas Munro
On Wed, Dec 13, 2017 at 4:20 PM, Thomas Munro wrote: > On Wed, Dec 13, 2017 at 3:41 PM, Amit Kapila wrote: >> Good. I hope that the patch I have posted above is able to resolve >> this problem. I am asking as you haven't explicitly mentioned that. > > I can confirm that your patch fixes the pro

Re: Parallel Index Scan vs BTP_DELETED and BTP_HALF_DEAD

2017-12-12 Thread Thomas Munro
On Wed, Dec 13, 2017 at 3:41 PM, Amit Kapila wrote: > Good. I hope that the patch I have posted above is able to resolve > this problem. I am asking as you haven't explicitly mentioned that. I can confirm that your patch fixes the problem for forward scans. That is, I can see it reaching the BT

Re: Parallel Index Scan vs BTP_DELETED and BTP_HALF_DEAD

2017-12-12 Thread Amit Kapila
On Wed, Dec 13, 2017 at 7:02 AM, Thomas Munro wrote: > Hi, > > Here's a reproducer which enabled me to reach this stuck state: > > pid | wait_event |query > ---+---+---

Re: Parallel Index Scan vs BTP_DELETED and BTP_HALF_DEAD

2017-12-12 Thread Thomas Munro
Hi, Here's a reproducer which enabled me to reach this stuck state: pid | wait_event |query ---+---+- 64617 | | select pid, wait_event, query from p

Re: Parallel Index Scan vs BTP_DELETED and BTP_HALF_DEAD

2017-12-12 Thread Amit Kapila
On Tue, Dec 12, 2017 at 4:00 PM, Kuntal Ghosh wrote: > On Mon, Dec 11, 2017 at 2:26 PM, Thomas Munro > wrote: >> On Mon, Dec 11, 2017 at 8:14 PM, Amit Kapila wrote: >> >>> Thanks for looking into it. I will see if we can write some test. In >>> the meantime if possible, can you please request

Re: Parallel Index Scan vs BTP_DELETED and BTP_HALF_DEAD

2017-12-12 Thread Kuntal Ghosh
On Mon, Dec 11, 2017 at 2:26 PM, Thomas Munro wrote: > On Mon, Dec 11, 2017 at 8:14 PM, Amit Kapila wrote: > >> Thanks for looking into it. I will see if we can write some test. In >> the meantime if possible, can you please request Patrick Hemmer to >> verify the attached patch? > > Our discus

Re: Parallel Index Scan vs BTP_DELETED and BTP_HALF_DEAD

2017-12-11 Thread Thomas Munro
On Mon, Dec 11, 2017 at 8:14 PM, Amit Kapila wrote: > On Mon, Dec 11, 2017 at 8:21 AM, Thomas Munro > wrote: >> ... and then it called _bt_parallel_seize() itself, in violation of >> the rule (by my reading of the code) that you must call >> _bt_parallel_release() (via _bt_readpage()) or _bt_para

Re: Parallel Index Scan vs BTP_DELETED and BTP_HALF_DEAD

2017-12-10 Thread Amit Kapila
On Mon, Dec 11, 2017 at 8:21 AM, Thomas Munro wrote: > Hi hackers, > > > ... and then it called _bt_parallel_seize() itself, in violation of > the rule (by my reading of the code) that you must call > _bt_parallel_release() (via _bt_readpage()) or _bt_parallel_done() > after seizing the scan. If

Re: Parallel Index Scan vs BTP_DELETED and BTP_HALF_DEAD

2017-12-10 Thread Thomas Munro
On Mon, Dec 11, 2017 at 3:51 PM, Thomas Munro wrote: > I heard a report of a 10.1 cluster hanging with several 'BtreePage' > wait_events showing in pg_stat_activity. I forgot to add, for bug reporter credit purposes: thanks to Patrick Hemmer for the off-list report and backtrace. He's able to wo