Re: 8.4.0 data loss / HOT-related bug - Mailing list pgsql-bugs

From Greg Stark
Subject Re: 8.4.0 data loss / HOT-related bug
Date
Msg-id 407d949e0908211130t440b4caar476172a64cc249d7@mail.gmail.com
Whole thread Raw
In response to Re: 8.4.0 data loss / HOT-related bug  (Radoslaw Zielinski <radek@pld-linux.org>)
Responses Re: 8.4.0 data loss / HOT-related bug  (Radoslaw Zielinski <radek@pld-linux.org>)
List pgsql-bugs
2009/8/21 Radoslaw Zielinski <radek@pld-linux.org>:
> Greg Stark <gsstark@mit.edu> [2009-08-21 18:38]:
> [...]
>> the toast table. Not unless you can dump the whole index and find
>> pointers in there or can find the details in the wal log.
>
> You mean the primary key index? =A0How do I dump it?

Actually I mean the key for the toast table.

Let me ask firstly do you get anything if you just do select * from
pg_toast.pg_toast_29644 where chunk_id =3D 120741 ?

And secondly, what do you get if you do "select length(htmlblob) from
tab where id =3D ?" which should work even if the toast data is broken.

To dump the index -- this will be tedious, but:

Load the pageinspect contrib module and run this:
select (x).* from (select bt_page_items('t_pkey',1) as x ) as y;
select (x).* from (select bt_page_items('t_pkey',2) as x ) as y;
...

Until you get an error. Then look through the output for any pointers

The hex at the end is the index key which in the case of a toast table
starts with the chunk id, you're looking for 120741 which is 0001D7A5
in hex or A5D70100 in little-endian...

If you find any such rows send them and they might tell us what's
going on or where to look for the missing toast records to see what's
going on.

However I'm kind of skeptical that you'll find any. IIRC Btree marks
pointers that it finds point to dead records and reuses them as soon
as possible. Still, maybe nothing's been inserted on that page yet.


--=20
greg
http://mit.edu/~gsstark/resume.pdf

pgsql-bugs by date:

Previous
From: Radoslaw Zielinski
Date:
Subject: Re: 8.4.0 data loss / HOT-related bug
Next
From: Tom Lane
Date:
Subject: Re: 8.4.0 data loss / HOT-related bug