Re: inconsistent state after crash recovery - Mailing list pgsql-hackers

From Tomasz Nowak
Subject Re: inconsistent state after crash recovery
Date
Msg-id CAPp0YYtS2wL_swxD3zB7+QH4+7Fg+AHC=J3m=G+B0iS3Jy5UFQ@mail.gmail.com
Whole thread Raw
In response to Re: inconsistent state after crash recovery  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hi,
  I'm very new here on this mailing list, but I've been using PostgreSQL for a while, and it scares me a little, that it's a real pain to try to recover data from corrupted table.

  Situations like file being lost following server crash (after fsck) or page corruption happens quite often.
 
  Having corruption at the row level for example, system could mark the page as corrupted in the system catalog.
  Giving that page knows last change to this page, can we use archived WAL-s to recover the page?
  We can have a table inside pg_catalog like pg_corrupted_pages with information of page corruption detected by backend.

  Similar to tables, in a case of lost file, once system notice that, we should have a column in pg_class called relneedrecovery to record that.
  Will it be possible to recover this file from last hot backup and apply redo to it based on WAL records?

  Similar functionality is provider by Oracle (media and block recovery).
  I assume we will need some extra DDL commands to handle file/block recovery.
  Also, It would be nice to have a command to quickly cross check files between pg_class and filesystem - just simple open/close system call for each relation - it is always faster that to run vaccum to check that.
Tomasz

On 2 August 2013 13:19, Robert Haas <robertmhaas@gmail.com> wrote:
On Fri, Aug 2, 2013 at 8:17 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Fri, Jul 26, 2013 at 8:27 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> would you expect crash recovery to notice the disappearance of a file
>>> that was touched nowhere in the replayed actions?
>
>> Eh, maybe not.  But should we try harder to detect the unexpected
>> disappearance of one that is?
>
> We do, don't we?  The replay stuff should complain unless it sees a drop
> or truncate covering any unaccounted-for pages.

Hmm.  Yeah.  But the OP seems to think it doesn't work.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



On 2 August 2013 13:19, Robert Haas <robertmhaas@gmail.com> wrote:
On Fri, Aug 2, 2013 at 8:17 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Fri, Jul 26, 2013 at 8:27 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> would you expect crash recovery to notice the disappearance of a file
>>> that was touched nowhere in the replayed actions?
>
>> Eh, maybe not.  But should we try harder to detect the unexpected
>> disappearance of one that is?
>
> We do, don't we?  The replay stuff should complain unless it sees a drop
> or truncate covering any unaccounted-for pages.

Hmm.  Yeah.  But the OP seems to think it doesn't work.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])
Next
From: Robert Haas
Date:
Subject: Re: Typo fix in bufmgr.c