Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1famYc-00034X-9c for pgsql-bugs@arkaria.postgresql.org; Wed, 04 Jul 2018 18:31:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1famYZ-0000ss-1B for pgsql-bugs@arkaria.postgresql.org; Wed, 04 Jul 2018 18:31:11 +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.89) (envelope-from ) id 1famYX-0000sg-Bk for pgsql-bugs@lists.postgresql.org; Wed, 04 Jul 2018 18:31:10 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1famYO-0001KX-6l for pgsql-bugs@postgresql.org; Wed, 04 Jul 2018 18:31:08 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id E8FB421AF1; Wed, 4 Jul 2018 14:30:56 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 04 Jul 2018 14:30:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=H0viAnHqqSdGwLnEDrunfxMom2ODIpCWHnl+SeUQJuU=; b=l/bPomx+ EKMwKqig+jUf9CWpXxOIg8/5fDkqarFzkRP9cbghycDGAfvmLzt13GVwWEvKCdR6 Pa8suBe7UiVmNCsUxbJhsHGM4Udah1g5nFB/Zb9IBAyniObnTxc+mPWOLafQ5+N+ 5ne1vFxoXVkArSV3olScaRGtNvxn8zvYGvGMxvV+3pK6zoU/uEJC5aFEm2JXYwjj NVqBRJJRtQ2Z+FZTLlTRe2IpyeDv6P0naRcG53YtPxd9m0vu0JoQcA30CyE0uZhJ A9Yih9iTLAjxnSR6ZrMd0Qn4I1qJLBltpJK6dEg5J12YAVEB6cjffxCnkDnPxPkQ qcZS76L09hrhKA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=H0viAnHqqSdGwLnEDrunfxMom2ODI pCWHnl+SeUQJuU=; b=ADVgfwhYmhz8xYmAuV6+rEmMrJtjY6CXRDiuH2KEUMI6k LXY5aO3J5J8Yqd7MBZyhAKUaFW47X3wz8RV+HYR3wJLOOSvBdWba3D5EulPjRL9S aV6NcpMahggjGgTI6VARSutu5iHket0OKnci0zgKTMRgKXWZa8BhKlohllFPxeIs ZoZepbApxNKcaEYTm1be7wp2V1cSbkKqA9eXNe7HTjB7UHfE5JO07DJyhz8fHaPv sDm3x+nccT2F3JtCQrdBj0UUo264wyk//F5ObVA5lhNnFm5AsPMFnUb8JAgzBFdk G7Acd8Ky6J7EqPd8u7CY53HLbJ0DQoRhbcRl3H9Qw== X-ME-Proxy: X-ME-Sender: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 5C8171025C; Wed, 4 Jul 2018 14:30:56 -0400 (EDT) Date: Wed, 4 Jul 2018 11:30:55 -0700 From: Andres Freund To: Jeff Janes Cc: Tom Lane , Andrey , Pg Bugs Subject: Re: NOTIFY does not work as expected Message-ID: <20180704183055.hqlqm3ramerybzvd@alap3.anarazel.de> References: <64711.1530595730@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2018-07-04 08:50:12 -0400, Jeff Janes wrote: > Reading through the comments touched by the commit, it seems obvious what > the bug is. It says "cause the processing to occur just before we next go > idle", but also says "This is called just *after* waiting for a frontend > command", which is too late to be "before we next go idle" I've not looked at this issue in depth yet. So I might be completely off base. But I'm confused by your comment - we're doing it *after*, because we do a non-blocking read. And the latch will notify us (event.events & WL_LATCH_SET) if there was a read. Are you arguing that we should also notify in cases where we actually never become idle? I'm not sure that's particularly meaningful, given there's no guarantee that that actually works, because we could just have read multiple commands from the client? Greetings, Andres Freund