From: Andres Freund <andres@anarazel.de>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Kevin Grittner <kgrittn@gmail.com>
Cc: Noah Misch <noah@leadboat.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 09:30:33 -0700
Message-ID: <20160720163033.4c4ku7orkzl7r4an@alap3.anarazel.de> (raw)
In-Reply-To: <CA+TgmoZWk1NK=kkU=v10p3YHKF6qNydttSD1v+XL2azp5PusyA@mail.gmail.com>
References: <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>
<CA+TgmoZWk1NK=kkU=v10p3YHKF6qNydttSD1v+XL2azp5PusyA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On 2016-07-20 11:26:11 -0400, Robert Haas wrote:
> On Wed, Jul 20, 2016 at 3:39 AM, Andres Freund <andres@anarazel.de> wrote:
> >>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.
>
> And how do you obtain that? The functions that reference
> SnapshotToast are toast_delete_datum, toastrel_value_exists, and
> toast_fetch_datum, toast_fetch_datum_slice, but none of those take a
> snapshot as an argument, nor is there any reasonable way to make them
> do so. Those are indirectly called by things like bttextcmp, which
> don't know what snapshot was used to fetch the datum that they are
> detoasting and can't reasonably be made to know.
>
> I mean, you could do something *approximately* correct by calling
> GetActiveSnapshot() but that doesn't seem likely to be correct in
> detail.
GetActiveSnapshot() seems like it should work well enough in this case,
or we could use pairingheap_first() to get the actual oldest registered
one.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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, robertmhaas@gmail.com, amit.kapila16@gmail.com, kgrittn@gmail.com, noah@leadboat.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: <20160720163033.4c4ku7orkzl7r4an@alap3.anarazel.de>
References: <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> <CA+TgmoZWk1NK=kkU=v10p3YHKF6qNydttSD1v+XL2azp5PusyA@mail.gmail.com> <20160720163033.4c4ku7orkzl7r4an@alap3.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