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 CAA4eK1JtxtiddvHZnELDYFoUxcocuOhxEQ3yPKo=wCpFx5oAfg@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  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Wed, Mar 22, 2017 at 3:39 PM, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
> Hi,
>
> On Wed, Mar 22, 2017 at 8:41 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> To fix this, I think we should pass 'REGBUF_KEEP_DATA' while
> registering the buffer. Something like this,
>
> -                       XLogRegisterBuffer(0, buf, REGBUF_STANDARD);
> +                       XLogRegisterBuffer(0, buf, REGBUF_STANDARD |
> REGBUF_KEEP_DATA);
>
> Attached is the patch that fixes this issue.
>

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.


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



pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: [HACKERS] Radix tree for character conversion
Next
From: Craig Ringer
Date:
Subject: Re: [HACKERS] [PATCH] Transaction traceability - txid_status(bigint)