Re: [HACKERS] Microvacuum support for Hash Index - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: [HACKERS] Microvacuum support for Hash Index
Date
Msg-id CAA4eK1KZPMm05gQDunjS3=BiLtgSrtiMbfiFFJM7M_Jpior5tA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Microvacuum support for Hash Index  (Ashutosh Sharma <ashu.coek88@gmail.com>)
Responses Re: [HACKERS] Microvacuum support for Hash Index  (Ashutosh Sharma <ashu.coek88@gmail.com>)
List pgsql-hackers
On Thu, Mar 16, 2017 at 9:39 PM, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
>>>
>>
>> Don't you think, we should also clear it during the replay of
>> XLOG_HASH_DELETE?  We might want to log the clear of flag along with
>> WAL record for XLOG_HASH_DELETE.
>>
>
> Yes, it should be cleared. I completely missed this part in a hurry.
> Thanks for informing. I have taken care of it in the attached v2
> patch.
>

+ /*
+ * Mark the page as not containing any LP_DEAD items. See comments
+ * in hashbucketcleanup() for details.
+ */
+ pageopaque = (HashPageOpaque) PageGetSpecialPointer(page);
+ pageopaque->hasho_flag &= ~LH_PAGE_HAS_DEAD_TUPLES;

Your comment here says, refer hashbucketcleanup and in that function,
the comment says "Clearing this flag is just a hint; replay won't redo
this.".  Both seems contradictory.  You need to change the comment in
hashbucketcleanup.  As I said in my previous e-mail, I think you need
to record clearing of this flag in WAL record XLOG_HASH_DELETE as you
are not doing this unconditionally and then during replay clear it
only when the WAL record indicates the same.

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



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: [HACKERS] logical decoding of two-phase transactions
Next
From: David Rowley
Date:
Subject: Re: [HACKERS] multivariate statistics (v25)