pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Vik Fearing <vik.fearing@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Code comment change
Date: Mon, 01 Jul 2019 22:28:43 -0400
Message-ID: <2931.1562034523@sss.pgh.pa.us> (raw)
In-Reply-To: <CAH2-WzmA2H+rL-xxF5o6QhMD+9x6cJTnz2Mr3Li_pbPBmqoTBQ@mail.gmail.com>
References: <150d3e9f-c7ec-3fb3-4fdb-def47c4144af@2ndquadrant.com>
	<CA+hUKGLSbKkSeGmkMAV=woD8wNKnMq3rYqoBeQwvysgDEgV8Lg@mail.gmail.com>
	<CAH2-WzmA2H+rL-xxF5o6QhMD+9x6cJTnz2Mr3Li_pbPBmqoTBQ@mail.gmail.com>

Peter Geoghegan <pg@bowt.ie> writes:
> On Sun, Jun 23, 2019 at 3:36 AM Thomas Munro <thomas.munro@gmail.com> wrote:
>> Pushed.  Thanks!

> I wonder what the comment is supposed to mean.
> I think that it's addressing the situation prior to commit 70508ba7aed
> in 2003, which was the point when the "fast" root concept was
> introduced.

Yeah.  I did some research into the provenance of that comment when
Thomas pushed the change.  It's *old*.  The whole para exists verbatim
in Postgres v4r2, src/backend/access/nbtree/nbtpage.c dated 1993-12-10
(in my copy of that tarball).  The only change since then has been to
change the whitespace for 4-space tabs.

Even more interesting, the same para also exists verbatim in
v4r2's src/backend/access/nobtree/nobtpage.c, which is dated 1991-10-29
in the same tarball.  (If you're wondering, "nobtree" seems to stand
for "no-overwrite btree"; so I suppose it went the way of all flesh
when Stonebraker lost interest in write-once mass storage.)  So presumably
this comment dates back to some common ancestor of the mainline btree code
and the no-overwrite code, which must have been even older than the 1991
date.

This is only marginally relevant to what we should do about it today,
but I think it's reasonable to conclude that the current locking
considerations are nearly unrelated to what they were when the comment
was written.

> I think that the whole sentence about "the standard class of race
> conditions" should go. There is no more dance. Nothing in
> _bt_getroot() is surprising to me. The other comments explain things
> comprehensively.

+1

			regards, tom lane





view thread (6+ messages)  latest in thread

Message-ID: <2931.1562034523@sss.pgh.pa.us>
Permalink:  ../2931.1562034523@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2931.1562034523@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pg@bowt.ie, thomas.munro@gmail.com, vik.fearing@2ndquadrant.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Code comment change
  In-Reply-To: <2931.1562034523@sss.pgh.pa.us>

* 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