Re: [HACKERS] Possibly too stringent Assert() in b-tree code

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Cc: amit.kapila16@gmail.com, robertmhaas@gmail.com, simon@2ndquadrant.com, ah@cybertec.at, pgsql-hackers@postgresql.org
Date: 2018-07-09T23:29:42Z
Lists: pgsql-hackers
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> writes:
> At Mon, 26 Sep 2016 09:12:04 +0530, Amit Kapila <amit.kapila16@gmail.com> wrote in <CAA4eK1K5YyDmndko0zzW6WNCN_DGFVHa6DCYcyuvkBWTH5+nUQ@mail.gmail.com>
>>> It seems to me that we do take actions for conflict resolution during
>>> the page deletion (that looks to be covered by XLOG_HEAP2_CLEANUP_INFO
>>> which we emit in vacuum), but not sure if that is sufficient.
>>> Consider a case where the new transaction is started on standby after
>>
>> Here by new transaction, I intend to say some newer snapshot with
>> valid MyPgXact->xmin.

> I agree to the diagnosis. So the WAL record is not necessary if
> it is a new page since no one cannot be grabbing it.

Thanks for reviving this thread and reviewing the problem.
I pushed the patch now with some more work on the comments.

			regards, tom lane


Commits

  1. Avoid emitting a bogus WAL record when recycling an all-zero btree page.