Re: hash index on unlogged tables doesn't behave as expected

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: hash index on unlogged tables doesn't behave as expected
Date: 2017-07-10 13:07:34
Message-ID: CAA4eK1KGK9pvW=Hn5yd51weEqWxGiKFC8HG8Bs1Ls1Pvfo5kwQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 10, 2017 at 3:27 PM, Kyotaro HORIGUCHI
<horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> Hi,
>
> At Mon, 10 Jul 2017 14:58:13 +0530, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote in <CAA4eK1JYyO5Hcxx4rP0jb=JmMC4qvY1YvG9UvkwNr5qrojsOPw(at)mail(dot)gmail(dot)com>
>
>> I am also not 100% comfortable with adding flush at two new places,
>> but that makes the code for fix simpler and fundamentally there is no
>> problem in doing so.
>
> I agree that the patch would be simpler. Ok, I am satisfied with
> an additional comment for _hash_init and hash_xlog_init_meta_page
> that describes the reason that _hash_init doesn't/can't use
> log_newpage and thus requires explicit flushes. Something like
> the description in [1] would be enough.
>

I have modified the comment in hash_xlog_init_meta_page and a
corresponding function for bitmap page. However, I think adding
anything about not using log_newpage in _hash_init doesn't sound good
to me. I think you have suggested it so that we don't forget the
reason for not using log_newpage, but I think that is overkill. Let
me know if you have any other concerns?

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

Attachment Content-Type Size
fix_unlogged_hash_index_issue_v3.patch application/octet-stream 4.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marina Polyakova 2017-07-10 13:21:28 Re: WIP Patch: Pgbench Serialization and deadlock errors
Previous Message Heikki Linnakangas 2017-07-10 13:01:50 Re: pgsql: Allow multiple hostaddrs to go with multiple hostnames.