Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aLA10-0001HU-I5 for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Jan 2016 13:38:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aLA0z-0000QQ-D3 for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Jan 2016 13:38:37 +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) (envelope-from ) id 1aLA0x-0000Pi-7B for pgsql-hackers@postgresql.org; Mon, 18 Jan 2016 13:38:35 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aLA0p-0000NZ-DH for pgsql-hackers@postgresql.org; Mon, 18 Jan 2016 13:38:34 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id 3ABE83A52F9; Mon, 18 Jan 2016 14:38:26 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-5.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from anarazel.de (p54BEB422.dip0.t-ipconnect.de [84.190.180.34]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id EA49D580004; Mon, 18 Jan 2016 14:38:15 +0100 (CET) Received: by anarazel.de (Postfix, from userid 1000) id 7E1581029AF; Mon, 18 Jan 2016 14:38:15 +0100 (CET) Date: Mon, 18 Jan 2016 14:38:15 +0100 From: Andres Freund To: Michael Paquier Cc: Robert Haas , Jeff Janes , "pgsql-hackers@postgresql.org" Subject: Re: Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby Message-ID: <20160118133815.GT10941@awork2.anarazel.de> References: <20151104103351.GB29170@awork2.anarazel.de> <20151106165235.GB21749@awork2.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 2015-12-21 16:26:25 +0900, Michael Paquier wrote: > On Sun, Dec 20, 2015 at 10:14 PM, Michael Paquier > wrote: > > Speaking of which, this patch was registered in this CF, I am moving > > it to the next as a bug fix. > > I found a stupid bug in my previous patch: when issuing XLOG_SWITCH it > is possible that the return LSN pointer is on the new segment that has > been forcibly archived if RequestXLogSwitch is called multiple times > and that subsequent calls are not necessary. Patch updated. I find this patch rather unsatisfactory. Yes, it kinda solves the problem of archive timeout, but it leaves the bigger and longer standing problems of unneccessary checkpoints with wal_level=hs in place. It's also somewhat fragile in my opinion. I think we rather want a per backend (or perhaps per wal insertion lock) flag that says 'last relevant record inserted at', and a way to not set that during insertion. Then during a checkpoint or the relevant bgwriter code, we look wether anything relevant happened in any backend since the last time we performed a checkpoint/logged a running xacts snapshot. Greetings, Andres Freund -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers