Re: Unlogged tables can vanish after a crash

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unlogged tables can vanish after a crash
Date: 2014-11-19 11:42:49
Message-ID: 20141119114249.GE17845@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2014-11-19 11:26:56 +0000, Albe Laurenz wrote:
> I observed an interesting (and I think buggy) behaviour today after one of
> our clusters crashed due to an "out of space" condition in the data directory.

Hah, just a couple days I pushed a fix for that ;)

http://archives.postgresql.org/message-id/20140912112246.GA4984%40alap3.anarazel.de
and
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=d3586fc8aa5d9365a5c50cb5e555971eb633a4ec

> So no crash recovery was performed, probably because the startup process
> failed *after* it completed the end-of-recovery checkpoint.
>
> Now the main fork files for all five unlogged tables are gone; the init fork files
> are still there.

You can "recover" them by restarting with -m immediate or so again.

> It seems to me that the right fix would be to recreate the unlogged
> relations *before* the checkpoint.

Yep, that's what we're doing now.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Albe Laurenz 2014-11-19 11:56:20 Re: Unlogged tables can vanish after a crash
Previous Message Petr Jelinek 2014-11-19 11:36:59 Re: tracking commit timestamps