Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hi8XN-0002AK-H0 for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Jul 2019 02:28:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hi8XL-0005Hp-Rt for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Jul 2019 02:28:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hi8XL-0005FA-Cf for pgsql-hackers@lists.postgresql.org; Tue, 02 Jul 2019 02:28:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hi8XJ-0004Py-0Q for pgsql-hackers@lists.postgresql.org; Tue, 02 Jul 2019 02:28:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x622ShR8002932; Mon, 1 Jul 2019 22:28:43 -0400 From: Tom Lane To: Peter Geoghegan cc: Thomas Munro , Vik Fearing , PostgreSQL Hackers Subject: Re: Code comment change In-reply-to: References: <150d3e9f-c7ec-3fb3-4fdb-def47c4144af@2ndquadrant.com> Comments: In-reply-to Peter Geoghegan message dated "Mon, 01 Jul 2019 19:03:24 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2930.1562034523.1@sss.pgh.pa.us> Date: Mon, 01 Jul 2019 22:28:43 -0400 Message-ID: <2931.1562034523@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Geoghegan writes: > On Sun, Jun 23, 2019 at 3:36 AM Thomas Munro 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