Re: Re: Missing rows with index scan when collation is not "C" (PostgreSQL 9.5)

From: Bernd Helmle <mailings(at)oopsware(dot)de>
To: Magnus Hagander <magnus(at)hagander(dot)net>, Peter Geoghegan <pg(at)heroku(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>, Marc-Olaf Jaschke <marc-olaf(dot)jaschke(at)s24(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Re: Missing rows with index scan when collation is not "C" (PostgreSQL 9.5)
Date: 2016-03-24 14:17:27
Message-ID: 87ED026F58B14BD890EC96A6@eje.credativ.lan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

--On 24. März 2016 14:04:22 +0100 Magnus Hagander <magnus(at)hagander(dot)net>
wrote:

> That's a good question? Would it catch corruption like this? I haven't
> actually tested it :) My understanding is that the thing that can happen
> is that while we don't actually store incorrect values in the indexes, we
> can end up with index pointers in the wrong order in the indexes with
> this bug? That does sound like one of those things that the amcheck tool
> is designed to find?

This is exactly where the prototype btreecheck helped a lot. The last time
i used it to track down problems we got

> WARNING: page order invariant violated for index

which nailed down collation problems on that specific machine and to
identify indexes, where we got the problem.

For example, if you take the bug report from Marc-Olaf and check the
affected table/index with the current amcheck patch, you get:

bernd(at)localhost:test #= SELECT bt_index_check('foo_val_idx');
ERROR: XX002: page order invariant violated for index "foo_val_idx"
DETAIL: Lower index tid=(1,1) (points to heap tid=(0,1)) higher index
tid=(1,2) (points to heap tid=(0,2)) page lsn=0/0.
LOCATION: bt_target_page_check, amcheck.c:687
STATEMENT: SELECT bt_index_check('foo_val_idx');

So if you ask me, this absolutely is a "must-have".

--
Thanks

Bernd

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Robbie Harwood 2016-03-24 15:07:16 Re: [HACKERS] BUG #13854: SSPI authentication failure: wrong realm name used
Previous Message Robert Haas 2016-03-24 14:14:06 Re: Re: Missing rows with index scan when collation is not "C" (PostgreSQL 9.5)

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-03-24 14:20:13 Re: Proposal: "Causal reads" mode for load balancing reads without stale data
Previous Message Robert Haas 2016-03-24 14:17:23 Re: [WIP] Effective storage of duplicates in B-tree index.