From: Tom Lane <tgl@sss.pgh.pa.us>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Antonin Houska <ah@cybertec.at>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Possibly too stringent Assert() in b-tree code
Date: Sun, 25 Sep 2016 12:01:00 -0400
Message-ID: <18732.1474819260@sss.pgh.pa.us> (raw)
In-Reply-To: <CAA4eK1JGM0216ZhQbSR58Sp9rgMiB=fg+SLv8Er_fqwZ+aVZcQ@mail.gmail.com>
References: <2628.1474272158@localhost>
<CAA4eK1Jv016Bw6qkxJG=e8wE24_x4wifoxm5QFeJxiTRGG_GOQ@mail.gmail.com>
<CA+Tgmoaj_N_kwqoHs61mugync10ppK_wM=zidf=HO9k9ypXs3A@mail.gmail.com>
<8962.1474570266@sss.pgh.pa.us>
<CAA4eK1JGM0216ZhQbSR58Sp9rgMiB=fg+SLv8Er_fqwZ+aVZcQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Amit Kapila <amit.kapila16@gmail.com> writes:
> On Fri, Sep 23, 2016 at 12:21 AM, Tom Lane <tgl@sss.pgh.pa.us> 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
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, amit.kapila16@gmail.com, robertmhaas@gmail.com, simon@2ndquadrant.com, ah@cybertec.at
Subject: Re: Possibly too stringent Assert() in b-tree code
In-Reply-To: <18732.1474819260@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