Re: Query running for very long time (server hanged) with parallel append

2018-02-08 Thread Robert Haas
On Wed, Feb 7, 2018 at 2:11 AM, Amit Khandekar wrote: > Attached is the patch accordingly. OK, I see. That makes sense; committed. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: Query running for very long time (server hanged) with parallel append

2018-02-06 Thread Amit Khandekar
On 7 February 2018 at 07:30, Kyotaro HORIGUCHI wrote: > At Tue, 6 Feb 2018 13:50:28 -0500, Robert Haas wrote > in >> On Tue, Feb 6, 2018 at 11:32 AM, Amit Khandekar >> wrote: >> > Yeah, I think it looks equally good that way, and like you said, the >> > current code does it that way. So in th

Re: Query running for very long time (server hanged) with parallel append

2018-02-06 Thread Kyotaro HORIGUCHI
At Tue, 6 Feb 2018 13:50:28 -0500, Robert Haas wrote in > On Tue, Feb 6, 2018 at 11:32 AM, Amit Khandekar > wrote: > > Yeah, I think it looks equally good that way, and like you said, the > > current code does it that way. So in the attached patch, I have > > swapped the two conditions. > > I

Re: Query running for very long time (server hanged) with parallel append

2018-02-06 Thread Robert Haas
On Tue, Feb 6, 2018 at 11:32 AM, Amit Khandekar wrote: > Yeah, I think it looks equally good that way, and like you said, the > current code does it that way. So in the attached patch, I have > swapped the two conditions. I prefer to avoid introducing 2 new variables and instead just prevent the

Re: Query running for very long time (server hanged) with parallel append

2018-02-06 Thread Amit Khandekar
On 6 February 2018 at 16:11, Kyotaro HORIGUCHI wrote: > Thanks for the explanation. I'm fine with it. Well may I make > some comments on the patch? Sure, always welcome. > > - It seems to me that the if (!should_warp_around) block and else > block are better be transposed so that make the bail

Re: Query running for very long time (server hanged) with parallel append

2018-02-06 Thread Kyotaro HORIGUCHI
At Tue, 6 Feb 2018 11:56:27 +0530, Amit Khandekar wrote in > On 6 February 2018 at 10:11, Kyotaro HORIGUCHI > wrote: > >> At Mon, 5 Feb 2018 15:29:27 +0530, Amit Khandekar > >> wrote in > >> > Attached is a patch that fixes this issue on the above lines. > >> > >> The patch adds two new varia

Re: Query running for very long time (server hanged) with parallel append

2018-02-05 Thread Rajkumar Raghuwanshi
On Mon, Feb 5, 2018 at 3:29 PM, Amit Khandekar wrote: > > Attached is a patch that fixes this issue on the above lines. > Patch applied cleanly and work fine for me. mentioned issue is not reproducible now. Thanks & Regards, Rajkumar Raghuwanshi QMG, EnterpriseDB Corporation

Re: Query running for very long time (server hanged) with parallel append

2018-02-05 Thread Amit Khandekar
On 6 February 2018 at 10:11, Kyotaro HORIGUCHI wrote: >> At Mon, 5 Feb 2018 15:29:27 +0530, Amit Khandekar >> wrote in >> > Attached is a patch that fixes this issue on the above lines. >> >> The patch adds two new variables and always sets them but warp >> around can happen at most once per cal

Re: Query running for very long time (server hanged) with parallel append

2018-02-05 Thread Kyotaro HORIGUCHI
At Tue, 06 Feb 2018 13:34:19 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20180206.133419.02213593.horiguchi.kyot...@lab.ntt.co.jp> > At Mon, 5 Feb 2018 15:29:27 +0530, Amit Khandekar > wrote in > > On 2 February 2018 at 20:46, Robert Haas wrote: > > > On Fri, Feb 2, 2018 at 1:43

Re: Query running for very long time (server hanged) with parallel append

2018-02-05 Thread Kyotaro HORIGUCHI
At Mon, 5 Feb 2018 15:29:27 +0530, Amit Khandekar wrote in > On 2 February 2018 at 20:46, Robert Haas wrote: > > On Fri, Feb 2, 2018 at 1:43 AM, Amit Khandekar > > wrote: > >> The query is actually hanging because one of the workers is in a small > >> loop where it iterates over the subplans

Re: Query running for very long time (server hanged) with parallel append

2018-02-05 Thread Amit Khandekar
On 2 February 2018 at 20:46, Robert Haas wrote: > On Fri, Feb 2, 2018 at 1:43 AM, Amit Khandekar wrote: >> The query is actually hanging because one of the workers is in a small >> loop where it iterates over the subplans searching for unfinished >> plans, and it never comes out of the loop (it's

Re: Query running for very long time (server hanged) with parallel append

2018-02-02 Thread David Kohn
Please forgive my inexperience with the codebase, but as the guy who reported this bugger: https://www.postgresql.org/message-id/flat/151724453314.1238.409882538067070269%40wrigleys.postgresql.org#151724453314.1238.409882538067070...@wrigleys.postgresql.org, I thought I'd follow your hints, as it's

Re: Query running for very long time (server hanged) with parallel append

2018-02-02 Thread Robert Haas
On Fri, Feb 2, 2018 at 1:43 AM, Amit Khandekar wrote: > On 2 February 2018 at 03:50, Thomas Munro > wrote: >> Whatever logic bug might be causing the query to hang, it's not good >> that we're unable to SIGINT/SIGTERM our way out of this state. See >> also this other bug report for a known prob

Re: Query running for very long time (server hanged) with parallel append

2018-02-01 Thread Amit Khandekar
On 2 February 2018 at 03:50, Thomas Munro wrote: > Whatever logic bug might be causing the query to hang, it's not good > that we're unable to SIGINT/SIGTERM our way out of this state. See > also this other bug report for a known problem (already fixed but not > yet released), but which came with

Re: Query running for very long time (server hanged) with parallel append

2018-02-01 Thread Thomas Munro
On Thu, Feb 1, 2018 at 11:29 PM, Rajkumar Raghuwanshi wrote: > I am getting server hang kind of issue with the below postgres.conf setup. > Issue may occur while running below query single/multiple times (random). > Not getting terminal back even after cancelling query. > explain output and query

Re: Query running for very long time (server hanged) with parallel append

2018-02-01 Thread Amit Khandekar
Thanks Rajkumar for catching this. I will have a look ... -- Thanks, -Amit Khandekar EnterpriseDB Corporation The Postgres Database Company

Query running for very long time (server hanged) with parallel append

2018-02-01 Thread Rajkumar Raghuwanshi
Hi, I am getting server hang kind of issue with the below postgres.conf setup. Issue may occur while running below query single/multiple times (random). Not getting terminal back even after cancelling query. explain output and query is given below. SET enable_hashjoin TO off; SET enable_nestloop