pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Davis <pgsql@j-davis.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: possible bug: orphaned files left after immediate shutdown during DDL
Date: Wed, 09 Feb 2011 22:58:46 -0500
Message-ID: <20348.1297310326@sss.pgh.pa.us> (raw)
In-Reply-To: <1297309026.11375.7.camel@jdavis-ux.asterdata.local>
References: <1297309026.11375.7.camel@jdavis-ux.asterdata.local>

Jeff Davis <pgsql@j-davis.com> writes:
> Case:

>   BEGIN;
>   CREATE TABLE foo AS SELECT generate_series(1,1000);
>   CHECKPOINT;
>   SELECT relfilenode FROM pg_class WHERE relname='foo';

> Let's say that returns 23456. Send the postmaster a SIGQUIT (immediate
> shutdown), and then restart. The file 23456 is still in the filesystem,
> but there's no record in pg_class for it. I don't see any obvious path
> where it will be removed, so it looks like it will just stay there
> forever.

> My question is: is this a conscious decision to be paranoid during
> recovery, or is this a bug?

It's intentional ... not that other people haven't complained about it
before.  Remember that what you have done is forced a crash, and
recovery from it is crash recovery.  If we proactively removed such
files we would very possibly be destroying evidence of forensic value.

IMO, immediate shutdown is not a tool to be used at random, and this
isn't something we need to fix.

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <20348.1297310326@sss.pgh.pa.us>
Permalink:  ../20348.1297310326@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20348.1297310326@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql@j-davis.com
  Subject: Re: possible bug: orphaned files left after immediate shutdown during DDL
  In-Reply-To: <20348.1297310326@sss.pgh.pa.us>
  References: <1297309026.11375.7.camel@jdavis-ux.asterdata.local> <20348.1297310326@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox