Re: Proposal: Integrity check

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Robert Mach <mach(dot)robert(at)gmail(dot)com>
Subject: Re: Proposal: Integrity check
Date: 2008-01-28 12:16:12
Message-ID: 479DC78C.6030608@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs wrote:
> On Fri, 2008-01-25 at 17:56 +0100, Zdenek Kotala wrote:
>> Regarding to Robert Mach's work during Google SOC on data integrity
>> check. I would like to improve storage module and implement some
>> Robert's code into the core.
>>
>> I would like to make following modification:
>>
>> 1) Add ReadBuffer_noerror (recommend me better name) function which will
>> accept damaged page without Error. This page will be marked as corrupted
>> and when ReadBuffer will touch this page then it will be handled in
>> standard way.
>>
>> This is important for check and repair functions to process all table
>> without interruption.
>
> We shouldn't let duff data into shared buffers at all.

As Tom mentioned before. I agree, it could cause a lot of problems.

> I think you could mix the two methods of reading buffers
>
> - start a subtransaction
> - read blocks into shared buffers
> - if error, then re-read block into private memory and examine
> - carry on thru table in a new subtransaction

It seems like good idea.

> OK with other points, except I don't want a new command. Let's do it as
> a function that can accept block ranges to check, not just whole tables.
> e.g. pg_check_blocks(17, 43) would check blocks 17 -> 43

It makes sense. I think following function should cover all cases:

pg_check_blocks() - all db
pg_check_blocks(relno) - all relation
pg_check_blocks(relno, start, stop) - selected interval
pg_check_blocks(relno, array of blocks) - selected blocks

Zdenek

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gokulakannan Somasundaram 2008-01-28 13:21:57 Re: [HACKERS] Including Snapshot Info with Indexes
Previous Message Zeugswetter Andreas ADI SD 2008-01-28 11:25:45 Re: [PATCHES] Proposed patch: synchronized_scanning GUC variable