Re: [HACKERS] WAL Consistency checking for hash indexes - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: [HACKERS] WAL Consistency checking for hash indexes
Date
Msg-id CAA4eK1KZRD7OVoKKvbUVgHeSFdrSbN0RmKpa6m_8FQK1mCsXqg@mail.gmail.com
Whole thread Raw
In response to [HACKERS] WAL Consistency checking for hash indexes  (Kuntal Ghosh <kuntalghosh.2007@gmail.com>)
Responses Re: [HACKERS] WAL Consistency checking for hash indexes  (Robert Haas <robertmhaas@gmail.com>)
Re: [HACKERS] WAL Consistency checking for hash indexes  (Kuntal Ghosh <kuntalghosh.2007@gmail.com>)
List pgsql-hackers
On Tue, Feb 28, 2017 at 11:06 AM, Kuntal Ghosh
<kuntalghosh.2007@gmail.com> wrote:
> Hello everyone,
>
> I've attached a patch which implements WAL consistency checking for
> hash indexes. This feature is going to be useful for developing and
> testing of WAL logging for hash index.
>

I think it is better if you base your patch on (Microvacuum support
for hash index - https://commitfest.postgresql.org/13/835/).

1.
There are some hints which we might want to mask that are used in that
patch.  For ex, I think you need to take care of Dead marking at page
level. Refer below code in patch "Microvacuum support for hash index".
+ if (killedsomething)
+ {
+ opaque->hasho_flag |= LH_PAGE_HAS_DEAD_TUPLES;


2.
+ else if ((opaque->hasho_flag & LH_BUCKET_PAGE) ||
+ (opaque->hasho_flag & LH_OVERFLOW_PAGE))
+ {
+ /*
+ * In btree bucket and overflow pages, it is possible to modify the
+ * LP_FLAGS without emitting any WAL record. Hence, mask the line
+ * pointer flags.
+ * See hashgettuple() for details.
+ */
+ mask_lp_flags(page);
+ }

Again, this mechanism is also modified by patch "Microvacuum support
for hash index", so above changes needs to be adjusted accordingly.
Comment referring to btree is wrong, you need to refer hash.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] PATCH: pageinspect / add page_checksum and bt_page_items(bytea)
Next
From: Ashutosh Bapat
Date:
Subject: Re: [HACKERS] Print correct startup cost for the group aggregate.