Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGbHX-0001Cu-CY for pgsql-committers@arkaria.postgresql.org; Tue, 13 Dec 2016 00:49:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cGbHW-0002n6-QU for pgsql-committers@arkaria.postgresql.org; Tue, 13 Dec 2016 00:49:22 +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 1cGbHJ-0002YU-Km for pgsql-committers@postgresql.org; Tue, 13 Dec 2016 00:49:09 +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 1cGbHH-0004ch-42 for pgsql-committers@postgresql.org; Tue, 13 Dec 2016 00:49:09 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id DEDF420999; Mon, 12 Dec 2016 19:49:05 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Mon, 12 Dec 2016 19:49:05 -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=zrPtFVyiZb5m9X wPPizySAVYu9E=; b=SlxJTV0ENEus/pjvSJYDdhsqyj3t5nzr8Y1+qBAy5jOTro Iq13FBr4nQFsTmFgLdK2K+JDR5lKhZMrfZ6iWbWribOquDQ14hJgCN1kRnbjEv6n uz+IeL81Yx921ddl6Pme5BGSFKajmFqwp/j6foth0CzHtVOKrBnA3oLa3/Jo0= X-ME-Sender: X-Sasl-enc: l2BjPbgYDyJbAflmXbcmpy37WBt0BZa4SGJocqMyQqgX 1481590145 Received: from intern.anarazel.de (unknown [208.71.159.84]) by mail.messagingengine.com (Postfix) with ESMTPA id 93EA57EDE5; Mon, 12 Dec 2016 19:49:05 -0500 (EST) Date: Mon, 12 Dec 2016 16:49:03 -0800 From: Andres Freund To: Petr Jelinek Cc: Tom Lane , Peter Eisentraut , pgsql-committers@postgresql.org Subject: Re: pgsql: Add support for temporary replication slots Message-ID: <20161213004903.iito2pefdrrjgny5@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> <48b2c017-695d-b5ac-2ff4-89b939b3e8f9@2ndquadrant.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48b2c017-695d-b5ac-2ff4-89b939b3e8f9@2ndquadrant.com> 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-13 01:42:48 +0100, Petr Jelinek wrote: > On 13/12/16 01:40, Tom Lane wrote: > > Petr Jelinek writes: > >> On 13/12/16 00:39, Tom Lane wrote: > >>> Hm, buildfarm says this didn't fix it. Where exactly does the dropping > >>> of the slot happen ... is it not complete by the time the backend exits? > > > >> 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. An awful lot of the > > 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. > > > > Well, the problem is that that's the place where the currently active > slot is released (if there was an active one). So we'd need to move that > part somewhere else as well. I am not sure what's the reasoning for > releasing it at that specific spot so CCing Andres. Why don't we just instead make the loop over pg_replication_slots? Andres -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers