Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aoie5-0000Gt-69 for pgsql-hackers@arkaria.postgresql.org; Sat, 09 Apr 2016 02:29:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aoie4-0001Mn-LP for pgsql-hackers@arkaria.postgresql.org; Sat, 09 Apr 2016 02:29:08 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aoie2-0001LJ-Rg for pgsql-hackers@postgresql.org; Sat, 09 Apr 2016 02:29:06 +0000 Received: from smtp-auth.no-ip.com ([8.23.224.61] helo=out.smtp-auth.no-ip.com) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1aoidz-0005xk-3F; Sat, 09 Apr 2016 02:29:05 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [186.11.2.106]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id C5B704008B0; Fri, 8 Apr 2016 19:28:59 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 644D06C; Fri, 8 Apr 2016 23:28:55 -0300 (CLT) Date: Fri, 8 Apr 2016 23:28:55 -0300 From: Alvaro Herrera To: Kevin Grittner Cc: pgsql-hackers@postgresql.org Subject: Re: [COMMITTERS] pgsql: Add the "snapshot too old" feature Message-ID: <20160409022855.GA728723@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.1 (-) 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 Kevin Grittner wrote: > Add the "snapshot too old" feature > > This feature is controlled by a new old_snapshot_threshold GUC. A > value of -1 disables the feature, and that is the default. The > value of 0 is just intended for testing. Above that it is the > number of minutes a snapshot can reach before pruning and vacuum > are allowed to remove dead tuples which the snapshot would > otherwise protect. The xmin associated with a transaction ID does > still protect dead tuples. A connection which is using an "old" > snapshot does not get an error unless it accesses a page modified > recently enough that it might not be able to produce accurate > results. I think this formulation of TestForOldSnapshot as returning the Page it checks is a bit strange; you seem to have done it that way only to be able to write BufferGetPage in a reasonable manner. I vote for changing both those macros into inline functions instead, pursuant to https://www.postgresql.org/message-id/20160409020835.GA727750%40alvherre.pgsql and have TestForOldSnapshot return void. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers