Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGbFA-0001AQ-Jr for pgsql-committers@arkaria.postgresql.org; Tue, 13 Dec 2016 00:46:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cGbF9-0001zP-VG for pgsql-committers@arkaria.postgresql.org; Tue, 13 Dec 2016 00:46:56 +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 1cGbF9-0001y4-A7 for pgsql-committers@postgresql.org; Tue, 13 Dec 2016 00:46:55 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cGbF6-0004bo-Je for pgsql-committers@postgresql.org; Tue, 13 Dec 2016 00:46:54 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 19C6120799; Mon, 12 Dec 2016 19:46:51 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Mon, 12 Dec 2016 19:46:51 -0500 DKIM-Signature: v=1; a=rsa-sha1; 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:x-sasl-enc; s=smtpout; bh=JR1eRMOHXIN4l2 H+M2xhHeIY2Fw=; b=Dreq5sVCrSynipNuAyn/pXnZwllCyMn9rMzhI/VzqEbrpp 3Pv1rQO+7NYvy/ccTYrCCTGjW+1sbD4CQhJh2kwIQgIpLqi62HN3UstSk24rxRD7 CuoIXpfeNitZimaey/OKhQH5SclAtgVri7pfYo1nJt15jPaIrlQXGdV0rwCHY= X-ME-Sender: X-Sasl-enc: jswASvzsJntaz8a0J3oRgqCGDz4hwzvS2+vpBBxDlMo2 1481590010 Received: from intern.anarazel.de (unknown [208.71.159.84]) by mail.messagingengine.com (Postfix) with ESMTPA id A60817EA0A; Mon, 12 Dec 2016 19:46:50 -0500 (EST) Date: Mon, 12 Dec 2016 16:46:48 -0800 From: Andres Freund To: Tom Lane Cc: Petr Jelinek , Peter Eisentraut , pgsql-committers@postgresql.org Subject: Re: pgsql: Add support for temporary replication slots Message-ID: <20161213004648.zww4z4rworue7kcg@alap3.anarazel.de> References: <27274.1481557380@sss.pgh.pa.us> <27833.1481558144@sss.pgh.pa.us> <62935e6f-4f1b-c433-e0fa-7f936a38b3e5@2ndquadrant.com> <22907.1481571177@sss.pgh.pa.us> <15713.1481585953@sss.pgh.pa.us> <314cae39-2e7d-f5a3-d226-cfb80cf80481@2ndquadrant.com> <18684.1481589637@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18684.1481589637@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org On 2016-12-12 19:40:37 -0500, Tom Lane wrote: > Petr Jelinek writes: > > Yes, I've seen. The cleanup of slots is done in ProcKill(), I wonder, > > since it's on_shmem_exit hook, and the pgstat_beshutdown_hook is as > > well, maybe the pgstat_beshutdown_hook is called before ProcKill and the > > query is lucky to hit right in between. > > Hm. That seems like a pretty bogus place to do it. Well, that'd not be Pet[e]r's fault. Robert and I had some preexisting slot cleanpucode there (which I'd like to consolidate btw). > backend infrastructure is already gone by then, if I recall the ordering > correctly. Maybe ShutdownPostgres would be a saner place; but it really > depends on what you think the module layering is for this facility. > I would definitely not think it is proc.c's responsibility, though. Slots quite possibly can used by bgworkers, so I don't think ShutdownPostgres would be right. I don't think there's a perfect place for it atm, so it's ProcKill()... - Andres -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers