Incorrect XLogRegisterBuffer flag for revmapbuf in brin - Mailing list pgsql-hackers

From Kuntal Ghosh
Subject Incorrect XLogRegisterBuffer flag for revmapbuf in brin
Date
Msg-id CAGz5QCJ=00UQjScSEFbV=0qO5ShTZB9WWz_Fm7+Wd83zPs9Geg@mail.gmail.com
Whole thread Raw
Responses Re: Incorrect XLogRegisterBuffer flag for revmapbuf in brin  (Michael Paquier <michael.paquier@gmail.com>)
Re: [HACKERS] Incorrect XLogRegisterBuffer flag for revmapbuf in brin  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Hi all,

In brin_doupdate(line 290), REGBUF_STANDARD is used to register
revmap buffer reference in WAL record. But, revmap buffer page doesn't
have a standard page layout and it doesn't update pd_upper and
pd_lower as well.

Either we should register revmapbuf as following:
XLogRegisterBuffer(1, revmapbuf, 0);
Or, we can update the pd_upper and pd_lower in brin_page_init() as follows:
if (BRIN_IS_REVMAP_PAGE(page))
p->pd_lower = p->upper.

To fix this, I've attached a small patch which follows the first approach.

--
Thanks & Regards,
Kuntal Ghosh
EnterpriseDB: http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Declarative partitioning - another take
Next
From: Peter Eisentraut
Date:
Subject: Re: IPv6 link-local addresses and init data type