Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VjwqU-0002tQ-Nm for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Nov 2013 19:56:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VjwqT-0005ax-HF for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Nov 2013 19:56:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VjwqM-0005QM-7u for pgsql-bugs@postgresql.org; Fri, 22 Nov 2013 19:56:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VjwqJ-0003kB-2S for pgsql-bugs@postgresql.org; Fri, 22 Nov 2013 19:56:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id rAMJuaf2024306; Fri, 22 Nov 2013 14:56:36 -0500 From: Tom Lane To: Stefan Kaltenbrunner cc: eduardoa@mirthcorp.com, pgsql-bugs@postgresql.org Subject: Re: BUG #8612: Truncate did not release disk space In-reply-to: <528FAC9A.6010801@kaltenbrunner.cc> References: <528FAC9A.6010801@kaltenbrunner.cc> Comments: In-reply-to Stefan Kaltenbrunner message dated "Fri, 22 Nov 2013 20:12:26 +0100" Date: Fri, 22 Nov 2013 14:56:36 -0500 Message-ID: <24305.1385150196@sss.pgh.pa.us> X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Stefan Kaltenbrunner writes: > On 11/20/2013 08:35 PM, eduardoa@mirthcorp.com wrote: >> The following bug has been logged on the website: >> >> Bug reference: 8612 >> Logged by: Eduardo Armendariz >> Email address: eduardoa@mirthcorp.com >> PostgreSQL version: 9.0.13 >> Operating system: CentOS >> Description: >> >> Ran out of disk space and postgres shut down. Recovered enough disk space >> for database to be operational. Truncated the largest table in the database, >> the message table. This table had over 600gb of data. The result of the >> truncate was that only about 200gb of the data was actually released to the >> OS. > sure that no other backend was/is actually still a file-handle > referenced? That open filehandle will prevent the OS from showing up the > freed space on the filesystem and can happen if you have backends still > running that once referenced the table now truncated and have not done > any work since you did the truncate (like a large connection pool or > idle client connections, maybe an open psql session or something like that). I think recent versions of PG contain logic that should ensure such open handles will be released within a reasonable period of time (like one checkpoint cycle). 9.0 I wouldn't bet on, though. If nothing else, a quick shutdown-and-restart of the database should release the space. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs