Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPhEr-0000Iz-9b for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Jul 2016 02:27:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bPhEq-0008Se-8U for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Jul 2016 02:27:56 +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 1bPhEm-0008P2-Ba for pgsql-hackers@postgresql.org; Wed, 20 Jul 2016 02:27:52 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bPhEj-0002DQ-2a; Wed, 20 Jul 2016 02:27:51 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id CBBCD206B1; Tue, 19 Jul 2016 22:27:46 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Tue, 19 Jul 2016 22:27:46 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=8QbL54unYPjoSkN HwGgitXiWG7A=; b=TM/YRUfiwHQ4ohciA1eKoB/hXzfLiVyIgs3sKdE+QGMstSx Rwf8rW1yc2QbxUM/1xjM9gwbh1McAivE+O33gp4Ji1bU1B4GvKlQ/dEIpJTGV6/y FftaVBTYeqhKNE/EzIBvSDoKtSq6hM2y1aZ4niDJehXlSobgVANgUXn+/YdE= X-Sasl-enc: CSm/Lqig1S/sIfi8z+ckXbrHbBRPquQBTHuBXIBbGe/I 1468981666 Received: from [IPv6:2607:fb90:2705:100b:a929:11e2:7196:8c0a] (unknown [172.56.38.196]) by mail.messagingengine.com (Postfix) with ESMTPA id 5A97DF29F4; Tue, 19 Jul 2016 22:27:45 -0400 (EDT) User-Agent: K-9 Mail for Android In-Reply-To: References: <20160708185221.ez2hnj4yalxaoqnm@alap3.anarazel.de> <20160713174838.oh53exchsuyxxply@alap3.anarazel.de> <20160716224808.GB1908970@tornado.leadboat.com> <20160719021047.GB2027798@tornado.leadboat.com> <20160719233250.nir5vyvzef7m4e7z@alap3.anarazel.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold < From: Andres Freund Date: Tue, 19 Jul 2016 19:27:40 -0700 To: Amit Kapila CC: Kevin Grittner ,Noah Misch ,Robert Haas ,Alvaro Herrera ,Ants Aasma ,Kevin Grittner ,"pgsql-hackers@postgresql.org" Message-ID: <1AB8F80A-D16E-4154-9497-98FBB164253D@anarazel.de> X-Pg-Spam-Score: -2.6 (--) 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 July 19, 2016 7:14:42 PM PDT, Amit Kapila wrote: >On Wed, Jul 20, 2016 at 5:02 AM, Andres Freund >wrote: >> On 2016-07-19 18:09:59 -0500, Kevin Grittner wrote: >>> As far as I can see, to do this the way that Andres and Amit >>> suggest involves tying in to indexam.c and other code in incredibly >>> ugly ways. >> >> Could you explain the problem you're seing? >> >> Isn't pretty much all all that we need to do: >> 1) add a InitSnapshotToast(Snapshot originMVCCSnap), which sets >SnapshotData->lsn >> to the the origin snapshot's lsn >> 2) adapt TestForOldSnapshot() to accept both HeapTupleSatisfiesMVCC >and >> HeapTupleSatisfiesToast? >> > >I also think so. However, it is not clear what is the best place to >initialize toast snapshot. One idea could be to do it in >GetSnapshotData() after capturing the required information for the >valid value of old_snapshot_threshold. Do you have something else in >mind? There's very few callsites using toast snapshots. I'd just do it there. Don't think we ever use GetSnapshotData for them. Andres -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers