Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 273C51337B93 for ; Wed, 9 Feb 2011 23:37:17 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 97865-04 for ; Thu, 10 Feb 2011 03:37:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gw0-f46.google.com (mail-gw0-f46.google.com [74.125.83.46]) by mail.postgresql.org (Postfix) with ESMTP id 10507133616B for ; Wed, 9 Feb 2011 23:37:08 -0400 (AST) Received: by gwj20 with SMTP id 20so399941gwj.19 for ; Wed, 09 Feb 2011 19:37:09 -0800 (PST) Received: by 10.101.179.6 with SMTP id g6mr11659378anp.157.1297309028787; Wed, 09 Feb 2011 19:37:08 -0800 (PST) Received: from [10.10.3.129] (71-6-94-66.static-ip.telepacific.net [71.6.94.66]) by mx.google.com with ESMTPS id x31sm1236613ana.9.2011.02.09.19.37.07 (version=SSLv3 cipher=RC4-MD5); Wed, 09 Feb 2011 19:37:08 -0800 (PST) Subject: possible bug: orphaned files left after immediate shutdown during DDL From: Jeff Davis To: pgsql-bugs@postgresql.org Content-Type: text/plain; charset="ISO-8859-1" Date: Wed, 09 Feb 2011 19:37:06 -0800 Message-ID: <1297309026.11375.7.camel@jdavis-ux.asterdata.local> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.6 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7 X-Spam-Level: X-Archive-Number: 201102/90 X-Sequence-Number: 29362 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? Or is there some reason that properly determining which files should be removed at recovery time is challenging? Regards, Jeff Davis