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

From Andres Freund
Subject Re: inconsistent state after crash recovery
Date
Msg-id 20130726064752.GG15081@alap2.anarazel.de
Whole thread Raw
In response to inconsistent state after crash recovery  (Satoshi Nagayasu <snaga@uptime.jp>)
Responses Re: inconsistent state after crash recovery
List pgsql-hackers
Hi,

On 2013-07-26 13:33:13 +0900, Satoshi Nagayasu wrote:
> I received a question about inconsistent state after crash recovery.
> 
> When a table file is broken (or just lost), PostgreSQL can not recover
> a whole table, and does not show any notice while recoverying.
> I think it means "inconsistent" state.
> 
> (1) create a table, and fill records.
> (2) process a checkpoint.
> (3) fill more records.
> (4) force a crash, and delete the table file.
> (5) run recovery on restarting.
> (6) only records after the checkpoint can be recoverd.
> 
> For example, the attached log shows that PostgreSQL can recover
> only 1058 records in the table which contains 2000 records
> before the crash, and does not tell anything in the server log.
> 
> Is this expected or acceptable?

I'd say it's both. WAL replay doesn't have the knowledge to detect that
in all too many cases. Nearly always a page's contents will be restored
by a full page image the first time it gets changed so they will
individually look completely normal.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Condition to become the standby mode.
Next
From: Fujii Masao
Date:
Subject: Re: comment for "fast promote"