Re: pg_verify_checksums failure with hash indexes

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Bernd Helmle <mailings(at)oopsware(dot)de>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_verify_checksums failure with hash indexes
Date: 2018-08-29 10:09:55
Message-ID: CAFiTN-sRH1N+ivm63V-bTt7bAkv9HvmCbNC2VnLJZpk6f0ybuA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 28, 2018 at 8:33 PM, Bernd Helmle <mailings(at)oopsware(dot)de> wrote:
> Am Dienstag, den 28.08.2018, 11:21 +0200 schrieb Peter Eisentraut:
>> This is reproducible with PG11 and PG12:
>>
>> initdb -k data
>> postgres -D data
>>
>> make installcheck
>> # shut down postgres with Ctrl-C
>>
>
> I tried to reproduce this and by accident i had a blocksize=4 in my
> configure script, and i got immediately failed installcheck results.
> They seem hash index related and can easily be reproduced:
>
> SHOW block_size ;
> block_size
> ────────────
> 4096
>
> CREATE TABLE foo(val text);
> INSERT INTO foo VALUES('bernd');
>
> CREATE INDEX ON foo USING hash(val);
> ERROR: index "foo_val_idx" contains corrupted page at block 0
> HINT: Please REINDEX it.
>
> I have no idea wether this could be related, but i thought it won't
> harm to share this here.
>

This issue seems different than the one got fixed in this thread. The
reason for this issue is that the size of the hashm_mapp in
HashMetaPageData is 4096, irrespective of the block size. So when the
block size is big enough (i.e. 8192) then there is no problem, but
when you set it to 4096, in that case, the hashm_mapp of the meta page
is overwriting the special space of the meta page. That's the reason
its showing corrupted page while checking the hash_page.

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2018-08-29 10:13:07 Use C99 designated initializers for some structs
Previous Message Yugo Nagata 2018-08-29 10:00:14 Re: pg_verify_checksums failure with hash indexes