On Thu, Nov 4, 2021 at 3:07 AM Peter Geoghegan <pg@bowt.ie> wrote:
>
> On Wed, Nov 3, 2021 at 3:26 AM PG Bug reporting form
> <noreply@postgresql.org> wrote:
> > it turns out one entry in toast index (?) was corrupted:
> > select md5(body) from zz where id = ...;
> > ERROR: missing chunk number 0 for toast value 4040061139 in
> > pg_toast_2624976286
> >
> > According to "created_at" column in linked table row was created at
> > "2021-11-02 13:04:22.192125", i.e. during reindex concurrently.
>
> I wonder if it's a coincidence that that number (~4.04 billion) is not
> that far from 2^32-1 (~4.294 billion).
>
> Can you run amcheck? Perhaps the output of the following will be interesting:
>
> create extension amcheck;
> set client_min_messages=debug1;
> select bt_index_check('pg_toast.pg_toast_2624976286_index', true);
>
> (Couldn't hurt to try it, at least.)
Hi Peter,
Please see a result of amcheck
select bt_index_check('pg_toast.pg_toast_2624976286_index', true);
DEBUG: verifying consistency of tree structure for index
"pg_toast_2624976286_index"
DEBUG: verifying level 3 (true root level)
DEBUG: verifying level 2
DEBUG: verifying level 1
DEBUG: verifying level 0 (leaf level)
DEBUG: leaf block 715360 of index "pg_toast_2624976286_index" has no
first data item
DEBUG: verifying that tuples from index "pg_toast_2624976286_index"
are present in "pg_toast_2624976286"
ERROR: heap tuple (59561917,1) from table "pg_toast_2624976286" lacks
matching index tuple within index "pg_toast_2624976286_index"
HINT: Retrying verification using the function
bt_index_parent_check() might provide a more specific error.
--
Maxim Boguk
Senior Postgresql DBA
https://dataegret.com/
Phone RU: +7 985 433 0000
Phone UA: +380 99 143 0000
Phone AU: +61 45 218 5678
LinkedIn: http://www.linkedin.com/pub/maksym-boguk/80/b99/b1b
Skype: maxim.boguk
"Доктор, вы мне советовали так не делать, но почему мне по-прежнему
больно когда я так делаю ещё раз?"