Re: [HACKERS] segfault in hot standby for hash indexes - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: [HACKERS] segfault in hot standby for hash indexes
Date
Msg-id CAA4eK1JsxPHVkAfhuo2=rHWgDNnGK7rZVAhhQ0QM0Nva8gU3Mg@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] segfault in hot standby for hash indexes  (Ashutosh Sharma <ashu.coek88@gmail.com>)
Responses Re: [HACKERS] segfault in hot standby for hash indexes  (Ashutosh Sharma <ashu.coek88@gmail.com>)
List pgsql-hackers
On Thu, Mar 23, 2017 at 4:26 PM, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
> On Thu, Mar 23, 2017 at 9:17 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>>
>> On Thu, Mar 23, 2017 at 8:43 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>> >
>> > I think this will work, but not sure if there is a merit to deviate
>> > from what btree does to handle this case.   One thing I find slightly
>> > awkward in hash_xlog_vacuum_get_latestRemovedXid() is that you are
>> > using a number of tuples registered as part of fixed data
>> > (xl_hash_vacuum_one_page) to traverse the data registered as buf data.
>> > I think it will be better if we register offsets also in fixed part of
>> > data as we are doing btree case.
>
> Agreed. I have made the changes accordingly. Please check attached v2 patch.
>

Changes look good to me.   I think you can modify the comments in
structure xl_hash_vacuum_one_page to mention "TARGET OFFSET NUMBERS
FOLLOW AT THE END"

>>
>> >
>> >
>>
>> Also another small point in this regard, do we need two separate
>> variables to track number of deleted items in below code?  I think one
>> variable is sufficient.
>>
>> _hash_vacuum_one_page()
>> {
>> ..
>> deletable[ndeletable++] = offnum;
>> tuples_removed += 1;--
> With Regards,
> Ashutosh Sharma
> EnterpriseDB:http://www.enterprisedb.com
>> ..
>> }
>>
>
> Yes, I think 'ndeletable' alone should be fine.
>

I think it would have been probably okay to use *int* for ntuples as
that matches with what you are actually assigning in the function.


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



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Monitoring roles patch
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] identity columns