Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d1OD6-0001RL-56 for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Apr 2017 02:22:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d1OD4-0006Kq-R5 for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Apr 2017 02:22:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d1OBZ-0003bT-Bu for pgsql-hackers@postgresql.org; Fri, 21 Apr 2017 02:20:37 +0000 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1d1OBS-0007ro-61 for pgsql-hackers@postgresql.org; Fri, 21 Apr 2017 02:20:36 +0000 Received: by mail-wm0-x22d.google.com with SMTP id r190so6305747wme.1 for ; Thu, 20 Apr 2017 19:20:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=DqP6HN1CS9s2LUfKwTFQMbszVtf7QsetVHCq1aNpXoA=; b=pX0XASVchE0VcJrkGPsCi8YGrmEL36G3eh4obPvg0BgyCPc1HGZosJWy+6tE5+L3Kw 3YaLZrjh5DSL+OcPgh/6nMUDqcSiIpOPngq3pYUZcnRmAI9riB/ArtSCcT2eodsBk7HZ ZHvn7kRC0DRFgPu6J/qQY7BCnkFb0eXyhS3gBEEZNUgql1Ld0E3KdcBg+gsbxNepSxlT vLPvnLBsLe8o7DTDxFx+Rs/la4+9mQPuM7mlxV58ezh3kMrBtzXDH11pYDrqH25LYfV6 8OoNjHG9GNC+neh1VdMTT/W0FhjxZ38i+OIGL3X8fP3FtpxStNxS+wcTFDSGx75J3KDG P3zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=DqP6HN1CS9s2LUfKwTFQMbszVtf7QsetVHCq1aNpXoA=; b=EL++gIvp42gZC/wfMej4rWG5ZmhDbY9QTQurR0OFKZ/ROnfNC3yWhmnQhDAZ3dg+2r EFtwW6XHfcZeuHz7Jixp8MiwJJKe4UR4xSAFkrjEG+iQfjzQ0Q1oxcA6rQpqNL7hq9f8 JFsOksXouTOiy5SdKjU85vhWhzUc6kbienOusJeW0WyTOpDhrknYEYul2iPM2iOPQoOa fouXO5K0A6B9N7E8zAIxR1eSM47N5Z695It/4g4IQqSSjWPWN/g9uJHj41hTW8+3cDpF +a0uCCiPwTbjuRZ2JAIqC6nePcnvhc6MwHCpRdTHbuTyR3T06z3/qMXeVpchTywIqS9c c5pw== X-Gm-Message-State: AN3rC/72l9cZ40P53Kl03/qsZ5AV0byOebGpA8f0dZKFbBTh4GMAqzZu VdJrAx93AhUgs+K3 X-Received: by 10.28.69.73 with SMTP id s70mr4507190wma.33.1492741228583; Thu, 20 Apr 2017 19:20:28 -0700 (PDT) Received: from [192.168.0.105] (150.123.broadband11.iol.cz. [90.178.123.150]) by smtp.gmail.com with ESMTPSA id y63sm395766wme.31.2017.04.20.19.20.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Apr 2017 19:20:27 -0700 (PDT) Subject: Re: walsender & parallelism To: Andres Freund , pgsql-hackers@postgresql.org, Petr Jelinek , Peter Eisentraut References: <20170421014030.fdzvvvbrz4nckrow@alap3.anarazel.de> From: Petr Jelinek Message-ID: Date: Fri, 21 Apr 2017 04:20:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170421014030.fdzvvvbrz4nckrow@alap3.anarazel.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 21/04/17 03:40, Andres Freund wrote: > > Since [1] walsender (not receiver as commit message says) can execute > SQL queries. While doing some testing of [2] I noticed that SQL queries > in walsender get stuck if parallelism is used - I have not investigated > why that is yet, but it surely is an issue. On first blush I'd suspect > that some signalling is not wired up correctly (cf. am_walsender branches > in PostgresMain() and such). Looks like SIGUSR1 being different is problem here - it's normally used to . I also noticed that we don't handle SIGINT (query cancel). I'll write proper patch but can you try to just use procsignal_sigusr1_handler for SIGUSR1 in walsender.c to see if it fixes the issue? BTW while looking at the code, I don't understand why we call latch_sigusr1_handler after calling SetLatch(MyLatch), shouldn't just the SetLatch be enough (they both end up calling sendSelfPipeByte() eventually)? -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers