Re: [GSOC] - I ntegrity check algorithm for data files

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Robert Mach <mach(dot)robert(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GSOC] - I ntegrity check algorithm for data files
Date: 2007-05-18 11:29:23
Message-ID: 20070518112923.GA29115@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 18, 2007 at 12:52:20PM +0200, Robert Mach wrote:
> Before presenting possible errors, I divided them into physical and
> logical errors. Physical errors will refer to errors in the structure of
> pages and tuples, whereas logical errors will depict errors that cause
> incorrect performance of postgresql, but are correct according the
> structure of data files.

Have you looked at pgfsck? I think you also need to check much lower
level stuff also. Let:
- Page headers
- Are all the item pointers in order an non-overlapping
- Is each item correctly structured, do the XIDs look OK. What about
the HINT bits. Can the tuple be decoded properly. One common problem
with data corruption is that postgres with see a varlen header which
says the daa is 2K (or 2M) whereas the item is only 50bytes long, so
that's obviously broken.

Only once you're sure about the actual structure can you worry about
thing like toast pointer (which are important, but less likely to crash
postgres).

All this applies to index pages also.

Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavan Deolasee 2007-05-18 11:59:44 Re: Concurrent psql patch
Previous Message Pavan Deolasee 2007-05-18 11:24:48 Re: Working with PostgreSQL source tree (was Re: Not ready for 8.3)