From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Petr Jelinek <petr.jelinek@2ndquadrant.com>
To: Andres Freund <andres@anarazel.de>
To: pgsql-hackers@postgresql.org
Subject: Re: walsender & parallelism
Date: Wed, 31 May 2017 23:51:08 -0400
Message-ID: <b0cae230-066c-d5ee-b2d7-29ba44c142bb@2ndquadrant.com> (raw)
In-Reply-To: <e9621798-2d3b-6342-06df-6149e7297039@2ndquadrant.com>
References: <20170421014030.fdzvvvbrz4nckrow@alap3.anarazel.de>
<e41081d2-080f-b612-2084-549fa652fae2@2ndquadrant.com>
<CAMsr+YGAKGcAVpEB7Br3yS9GNdB-KEF0LJEpHPiyf7XFnBr2PQ@mail.gmail.com>
<a6167509-dc9f-411b-3bbd-758ab8079139@2ndquadrant.com>
<7966f454-7cd7-2b0c-8b70-cdca9d5a8c97@2ndquadrant.com>
<20170423235941.qosiuoyqprq4nu7v@alap3.anarazel.de>
<20170424000452.3iab4qpc3mtb2v6v@alap3.anarazel.de>
<a8b44e9f-6631-3f2c-377b-0f5671784baf@2ndquadrant.com>
<13973428-ca0b-b329-7f32-f15150e10334@2ndquadrant.com>
<20170424232559.j5zuna3rpzksj26l@alap3.anarazel.de>
<81eaca60-3f7b-6a21-5531-fd51ffbf3f63@2ndquadrant.com>
<5fe9977b-1961-d663-004f-d138a74860ed@2ndquadrant.com>
<0AD1D877-EFA4-4B11-A074-6B83D90402EA@anarazel.de>
<e9621798-2d3b-6342-06df-6149e7297039@2ndquadrant.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On 5/23/17 13:57, Petr Jelinek wrote:
> On 23/05/17 19:45, Andres Freund wrote:
>>
>>
>> On May 23, 2017 1:42:41 PM EDT, Petr Jelinek <petr.jelinek@2ndquadrant.com> wrote:
>>> Hi,
>>>
>>> so this didn't really move anywhere AFAICS, do we think the approach
>>> I've chosen is good or do we want to do something else here?
>>
>> Can you add it to the open items list?
>>
>
> Done
I think the easiest and safest thing to do now is to just prevent
parallel plans in the walsender. See attached patch. This prevents the
hang in the select_parallel tests run under your new test setup.
Unifying the signal handling and query processing further seems like a
good idea, but the patches are pretty involved, so I suggest to put them
into the next commit fest.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackersAttachments:0001-Prevent-parallel-query-in-walsender.patch (text/plain, 1.4K) download
From 26002c4e58647c67cce97e66b34b489bb838e39a Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Wed, 31 May 2017 23:27:13 -0400
Subject: [PATCH] Prevent parallel query in walsender
Parallel query in walsender currently hangs, because walsender does not
have the full SIGUSR1 signal handler to handle this. It's safer and
easier to prevent using a parallel plan for now. Eventually, the signal
handling in walsender should be unified with regular backends.
Reported-by: Andres Freund <andres@anarazel.de>
---
src/backend/optimizer/plan/planner.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.cindex 40cb79d4cd..bb921ba29c 100644--- a/src/backend/optimizer/plan/planner.c+++ b/src/backend/optimizer/plan/planner.c@@ -50,6 +50,7 @@
#include "parser/analyze.h"
#include "parser/parsetree.h"
#include "parser/parse_agg.h"
+#include "replication/walsender.h"
#include "rewrite/rewriteManip.h"
#include "storage/dsm_impl.h"
#include "utils/rel.h"
@@ -272,6 +273,7 @@ standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
*/
if ((cursorOptions & CURSOR_OPT_PARALLEL_OK) != 0 &&
IsUnderPostmaster &&
+ !am_walsender &&
dynamic_shared_memory_type != DSM_IMPL_NONE &&
parse->commandType == CMD_SELECT &&
!parse->hasModifyingCTE &&
--
2.13.0
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: peter.eisentraut@2ndquadrant.com, petr.jelinek@2ndquadrant.com, andres@anarazel.de
Subject: Re: walsender & parallelism
In-Reply-To: <b0cae230-066c-d5ee-b2d7-29ba44c142bb@2ndquadrant.com>
References: <20170421014030.fdzvvvbrz4nckrow@alap3.anarazel.de> <e41081d2-080f-b612-2084-549fa652fae2@2ndquadrant.com> <CAMsr+YGAKGcAVpEB7Br3yS9GNdB-KEF0LJEpHPiyf7XFnBr2PQ@mail.gmail.com> <a6167509-dc9f-411b-3bbd-758ab8079139@2ndquadrant.com> <7966f454-7cd7-2b0c-8b70-cdca9d5a8c97@2ndquadrant.com> <20170423235941.qosiuoyqprq4nu7v@alap3.anarazel.de> <20170424000452.3iab4qpc3mtb2v6v@alap3.anarazel.de> <a8b44e9f-6631-3f2c-377b-0f5671784baf@2ndquadrant.com> <13973428-ca0b-b329-7f32-f15150e10334@2ndquadrant.com> <20170424232559.j5zuna3rpzksj26l@alap3.anarazel.de> <81eaca60-3f7b-6a21-5531-fd51ffbf3f63@2ndquadrant.com> <5fe9977b-1961-d663-004f-d138a74860ed@2ndquadrant.com> <0AD1D877-EFA4-4B11-A074-6B83D90402EA@anarazel.de> <e9621798-2d3b-6342-06df-6149e7297039@2ndquadrant.com> <b0cae230-066c-d5ee-b2d7-29ba44c142bb@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox