Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGbPF-0001UC-L7 for pgsql-committers@arkaria.postgresql.org; Tue, 13 Dec 2016 00:57:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cGbPF-00051L-1T for pgsql-committers@arkaria.postgresql.org; Tue, 13 Dec 2016 00:57:21 +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 1cGbP1-0004mD-5i for pgsql-committers@postgresql.org; Tue, 13 Dec 2016 00:57:07 +0000 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cGbOy-0004nO-4r for pgsql-committers@postgresql.org; Tue, 13 Dec 2016 00:57:06 +0000 Received: by mail-wm0-x22a.google.com with SMTP id f82so95735458wmf.1 for ; Mon, 12 Dec 2016 16:57:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=fp7U0U3F+YLAl5xeDcZPi2WqcvPMnzTMZ2ETl8EgzQ0=; b=urMAgU4oSh3vsz+PhUoSTbJWD7mmzqqEp8wkZ1mo5Gk8AZbCU59BsmVp6AVdfm1gtC Sl5U9QnypGYtJEGsded7teQXV15tNaDNeiXqkL0oekyuQJGJzV1sHHn0nn7MXjf7BXZy HwDYiFS32UOrfKco0iKHum4FB2hhPIgUejeJv1qnlgCfFZTUMFuPnU3g54TeyRYTUI9c zGhvITi8k9glSav97BM0deFswXTqCieT9SAQrfseJimcP8pKN+pZu3oMzWYaVfW5qMZi sOkSYpjdT4Hj784CSmTTTsvugM3zTin3VyVmN30oY9BCxXzdD8AXzVq/cqmamYyuxJXe 9hPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=fp7U0U3F+YLAl5xeDcZPi2WqcvPMnzTMZ2ETl8EgzQ0=; b=Hb3rp/abieTlvc8TMs+hOou4eigN1M3A/j0rckIItzh+idLRpS5b/x/aYidHk1/y4P 6lCHBz0le2KVtR97wTTSfVCfgJC3HoMuReE0ARX7BBrVIzJqoTMTshEhbAo2yxv+DH6o HPkmOKQSxmpb+qQE1AG3crgw55l0cymMcx5mBTEAfsvD8kOyxYUqFfBUORXgpDOqe7P6 V3vU01LcQNHsL4hTv7qf3vXu0HzkJ9bGltZ3Lmb3CxipMMhYThrAnZFvwgqrC4S9L8fZ njVlMTXnHGYRLqE4y2WNNqygaHJGD/RPRhBWoNVhJO6fUxU3iDLgmw/G4+zuoyNQzFJ9 /VSA== X-Gm-Message-State: AKaTC01Rydb0NPLcWST/jOG5E6tCEgsLUrQzUz1bahdcZBWdH2jLacG+EyXR3hYL7gJvbXO+l1VLnO/tSGgtd65CRtRfjP8CmfkrnLExkWpSp8TmJ1sL++Dx5ASy4Od/j23rxdJXzGslcUHpUVSWT53UzDgVgKw6guStYDXPN0qkozXJi5aDYYuw+soK+yDL7ctJmbeZVb3BAnV3 X-Received: by 10.28.94.205 with SMTP id s196mr172004wmb.1.1481590623249; Mon, 12 Dec 2016 16:57:03 -0800 (PST) Received: from [192.168.0.105] (150.123.broadband11.iol.cz. [90.178.123.150]) by smtp.gmail.com with ESMTPSA id w8sm51972wmw.4.2016.12.12.16.57.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Dec 2016 16:57:02 -0800 (PST) Subject: Re: pgsql: Add support for temporary replication slots To: Andres Freund 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> <20161213004903.iito2pefdrrjgny5@alap3.anarazel.de> Cc: Tom Lane , Peter Eisentraut , pgsql-committers@postgresql.org From: Petr Jelinek Message-ID: <6886c56a-f6c8-3c44-53a1-dae6c24afb76@2ndquadrant.com> Date: Tue, 13 Dec 2016 01:57:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20161213004903.iito2pefdrrjgny5@alap3.anarazel.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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 13/12/16 01:49, Andres Freund wrote: > 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? > I mentioned that as possible solution upthread, I am only worried that the failure scenario is basically infinite loop. -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers