pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Kevin Grittner <kgrittn@gmail.com>
Cc: Noah Misch <noah@leadboat.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Ants Aasma <ants.aasma@eesti.ee>
Cc: Kevin Grittner <kgrittn@postgresql.org>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <
Date: Wed, 20 Jul 2016 00:39:50 -0700
Message-ID: <C9566A4D-9A6B-4CA9-8E52-45453C58B58D@anarazel.de> (raw)
In-Reply-To: <CAA4eK1+XqXfkyyBRSJ0ZX8THzMS15NYq=cA5ZSB5KVytvLb51w@mail.gmail.com>
References: <CACjxUsNCbsq_p_pVbrjHGfUnFw4i-FtjnHeZrpkOBNUEE_w45Q@mail.gmail.com>
	<20160708185221.ez2hnj4yalxaoqnm@alap3.anarazel.de>
	<CACjxUsNdQdwiU1em=xYsRmgCYV=2FT4nFn9uSA76JEovgLtM9A@mail.gmail.com>
	<CAA4eK1+B4fu5haTGg1ajyuRF9EK2ZhJsgTu7cT1GDArPHqe+0w@mail.gmail.com>
	<CACjxUsNERjp3BBBWfgs4mg3CyA+O0ATN1=O4NM3MWC3_LHP-dg@mail.gmail.com>
	<20160713174838.oh53exchsuyxxply@alap3.anarazel.de>
	<CACjxUsM=QefOrSyO3ReKJu+7_HMLsF4mL=eKVTT=J-9PPzdz8A@mail.gmail.com>
	<20160716224808.GB1908970@tornado.leadboat.com>
	<20160719021047.GB2027798@tornado.leadboat.com>
	<CACjxUsMujjg0peWzBdnNzWPdbMTzZj2j+KgNpEvWdFw+FGYTzA@mail.gmail.com>
	<20160719233250.nir5vyvzef7m4e7z@alap3.anarazel.de>
	<CAA4eK1JuPpk+ShSfabtGjBBdXOA05+GCbsrq=eUy0Y92a_JQQQ@mail.gmail.com>
	<1AB8F80A-D16E-4154-9497-98FBB164253D@anarazel.de>
	<CAA4eK1+XqXfkyyBRSJ0ZX8THzMS15NYq=cA5ZSB5KVytvLb51w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>



On July 19, 2016 7:43:05 PM PDT, Amit Kapila <amit.kapila16@gmail.com> wrote:
>On Wed, Jul 20, 2016 at 7:57 AM, Andres Freund <andres@anarazel.de>
>wrote:
>>
>>
>> On July 19, 2016 7:14:42 PM PDT, Amit Kapila
><amit.kapila16@gmail.com> wrote:
>>>On Wed, Jul 20, 2016 at 5:02 AM, Andres Freund <andres@anarazel.de>
>>>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.
>>
>
>I think Snapshot's members whenTaken and lsn are updated/initialized
>only in GetSnapshotData().  So if GetSnapshotData() is not used, how
>will you expect those fields to be updated.  We need those fields to
>be updated for TestForOldSnapshot().

That's why I suggested copying them from the current mvcc snapshot.

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



view thread (195+ messages)  latest in thread

Message-ID: <C9566A4D-9A6B-4CA9-8E52-45453C58B58D@anarazel.de>
Permalink:  ../C9566A4D-9A6B-4CA9-8E52-45453C58B58D@anarazel.de/
Also on:    postgresql.org/message-id/C9566A4D-9A6B-4CA9-8E52-45453C58B58D@anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de, amit.kapila16@gmail.com, kgrittn@gmail.com, noah@leadboat.com, robertmhaas@gmail.com, alvherre@2ndquadrant.com, ants.aasma@eesti.ee, kgrittn@postgresql.org, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <
  In-Reply-To: <C9566A4D-9A6B-4CA9-8E52-45453C58B58D@anarazel.de>
  References: <CACjxUsNCbsq_p_pVbrjHGfUnFw4i-FtjnHeZrpkOBNUEE_w45Q@mail.gmail.com> <20160708185221.ez2hnj4yalxaoqnm@alap3.anarazel.de> <CACjxUsNdQdwiU1em=xYsRmgCYV=2FT4nFn9uSA76JEovgLtM9A@mail.gmail.com> <CAA4eK1+B4fu5haTGg1ajyuRF9EK2ZhJsgTu7cT1GDArPHqe+0w@mail.gmail.com> <CACjxUsNERjp3BBBWfgs4mg3CyA+O0ATN1=O4NM3MWC3_LHP-dg@mail.gmail.com> <20160713174838.oh53exchsuyxxply@alap3.anarazel.de> <CACjxUsM=QefOrSyO3ReKJu+7_HMLsF4mL=eKVTT=J-9PPzdz8A@mail.gmail.com> <20160716224808.GB1908970@tornado.leadboat.com> <20160719021047.GB2027798@tornado.leadboat.com> <CACjxUsMujjg0peWzBdnNzWPdbMTzZj2j+KgNpEvWdFw+FGYTzA@mail.gmail.com> <20160719233250.nir5vyvzef7m4e7z@alap3.anarazel.de> <CAA4eK1JuPpk+ShSfabtGjBBdXOA05+GCbsrq=eUy0Y92a_JQQQ@mail.gmail.com> <1AB8F80A-D16E-4154-9497-98FBB164253D@anarazel.de> <CAA4eK1+XqXfkyyBRSJ0ZX8THzMS15NYq=cA5ZSB5KVytvLb51w@mail.gmail.com> <C9566A4D-9A6B-4CA9-8E52-45453C58B58D@anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox