Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1amyDC-00086c-JR for pgsql-committers@arkaria.postgresql.org; Mon, 04 Apr 2016 06:42:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1amyDB-00061Q-Ut for pgsql-committers@arkaria.postgresql.org; Mon, 04 Apr 2016 06:42:09 +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 1amyDB-00061F-KJ for pgsql-committers@postgresql.org; Mon, 04 Apr 2016 06:42:09 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1amyD9-0005w9-4h for pgsql-committers@postgresql.org; Mon, 04 Apr 2016 06:42:09 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id C4C4B3B4BDE; Mon, 4 Apr 2016 08:42:05 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 Received: from andres.at.anarazel.de.authenticated.anarazel.de by mail.anarazel.de (Postfix) with ESMTPSA id F053E3B4BDE for ; Mon, 4 Apr 2016 08:42:02 +0200 (CEST) Received: by anarazel.de (Postfix, from userid 1000) id 799C5101CF8; Mon, 4 Apr 2016 08:42:02 +0200 (CEST) Date: Mon, 4 Apr 2016 08:42:02 +0200 From: Andres Freund To: Simon Riggs Cc: pgsql-committers Subject: Re: pgsql: Avoid archiving XLOG_RUNNING_XACTS on idle server Message-ID: <20160404064202.GE2431@awork2.anarazel.de> References: <20160404062450.GB2431@awork2.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -5.2 (-----) 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-04-04 07:31:46 +0100, Simon Riggs wrote: > On 4 April 2016 at 07:24, Andres Freund wrote: > > > On 2016-04-04 06:19:04 +0000, Simon Riggs wrote: > > > Avoid archiving XLOG_RUNNING_XACTS on idle server > > > > > > If archive_timeout > 0 we should avoid logging XLOG_RUNNING_XACTS if > > idle. > > > > > > Bug 13685 reported by Laurence Rowe, investigated in detail by Michael > > Paquier, > > > though this is not his proposed fix. > > > 20151016203031.3019.72930@wrigleys.postgresql.org > > > > > > Simple non-invasive patch to allow later backpatch to 9.4 and 9.5 > > > > Uh. This is wrong. > > > For one it breaks cleanup with logical decoding which > > does *NEED* to know that nothing is happening. Although only once, not > > repeatedly. > > > > If the patch did that, I agree it would be wrong. It doesn't, > deliberately. It doesn't? + if (running->xcnt == 0 && + nlocks == 0 && + XLogArchiveTimeout > 0 && + !last_snapshot_overflowed) + { + LWLockRelease(XidGenLock); + return InvalidXLogRecPtr; + } Overflowed snapshots aren't a problem for logical decoding. But we need to know that no old transactions are running occasionally. Andres -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers