Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1boBrj-0002f0-Qe for pgsql-hackers@arkaria.postgresql.org; Sun, 25 Sep 2016 16:01:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1boBrj-0006nm-8c for pgsql-hackers@arkaria.postgresql.org; Sun, 25 Sep 2016 16:01:19 +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 1boBrd-0006ik-DD for pgsql-hackers@postgresql.org; Sun, 25 Sep 2016 16:01:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1boBra-0001C0-IH for pgsql-hackers@postgresql.org; Sun, 25 Sep 2016 16:01:12 +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 u8PG10tD018733; Sun, 25 Sep 2016 12:01:00 -0400 From: Tom Lane To: Amit Kapila cc: Robert Haas , Simon Riggs , Antonin Houska , pgsql-hackers Subject: Re: Possibly too stringent Assert() in b-tree code In-reply-to: References: <2628.1474272158@localhost> <8962.1474570266@sss.pgh.pa.us> Comments: In-reply-to Amit Kapila message dated "Sat, 24 Sep 2016 18:36:49 +0530" Date: Sun, 25 Sep 2016 12:01:00 -0400 Message-ID: <18732.1474819260@sss.pgh.pa.us> X-Pg-Spam-Score: -5.0 (-----) 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 Amit Kapila writes: > On Fri, Sep 23, 2016 at 12:21 AM, Tom Lane wrote: >> This is clearly an oversight in Simon's patch fafa374f2, which introduced >> this code without any consideration for the possibility that the page >> doesn't have a valid special area. ... >> but I'm not very clear on whether this is a safe fix, mainly because >> I don't understand what the reuse WAL record really accomplishes. >> Maybe we need to instead generate a reuse record with some special >> transaction ID indicating worst-case assumptions? > I think it is basically to ensure that the queries on standby should > not be considering the page being recycled as valid and if there is > any pending query to which this page is visible, cancel it. If this > understanding is correct, then I think the fix you are proposing is > correct. After thinking about it some more, I do not understand why we are emitting WAL here at all in *any* case, either for a new page or for a deleted one that we're about to recycle. Why wouldn't the appropriate actions have been taken when the page was deleted, or even before that when its last tuple was deleted? In other words, if I'm left to fix it, I will do so by reverting fafa374f2 lock stock and barrel. I think it was ill-considered and unnecessary. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers