Re: Excessive space allocations in Postgresql 9.1.6 system files causing the file system to run out of space.

From: <fburgess(at)radiantblue(dot)com>
To: "Andres Freund" <andres(at)2ndquadrant(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Excessive space allocations in Postgresql 9.1.6 system files causing the file system to run out of space.
Date: 2013-03-01 15:20:31
Message-ID: 20130301082031.5a830134ae84016b0174832fdc1a3173.c8e37496f5.wbe@email11.secureserver.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

<html><body><span style="font-family:Verdana; color:#000000; font-size:10pt;"><div>Not sure why&nbsp;my emails replies&nbsp;went&nbsp;out in HTML format, I'm re-sending the email trail to date. Thanks Andres for pointing this out.</div>
<div>&nbsp;</div>
<div>Freddie</div>
<div>&nbsp;</div>
<div>----- Most recent Reply -------</div>
<div>We did use pg_upgrade with the hard link option. We are not sure if we ran the cleanup script. <BR>&nbsp;<BR>Not sure which script you are referring to? Is that script the one that removes the stuff in the source bin directory?<BR>&nbsp;<BR>We did the pg_largeobject.sql script, as we were instructed by the pg_upgrade process. We also ran vacuum --all --analyzeonly <BR>&nbsp;<BR>Can we run this script now, even though its month's after we did the upgrade?<BR>&nbsp;<BR>Our tablespace structure to help sort out the previously sent directories list:<BR>&nbsp;<BR>CREATE TABLESPACE user_data LOCATION '/opt/PostgreSQL/9.1/data/user_data';<BR>&nbsp;<BR>CREATE TABLESPACE track_data_year_underflow LOCATION '/opt/PostgreSQL/9.1/data/track_data/year_underflow'; The "year_underflow" tablespace contains all data older than the oldest date.<BR>CREATE TABLESPACE track_data_y2010 LOCATION '/opt/PostgreSQL/9.1/data/track_data/year2010';<BR>CREATE TABLESPACE track_data-y2011 LOCATION '/opt/PostgreSQL/9.1/data/track_data/year2011';<BR>CREATE TABLESPACE track_data-y2012 LOCATION '/opt/PostgreSQL/9.1/data/track_data/year2012';</div>
<div>&nbsp;</div>
<div>-------- Original Message --------<BR>Subject: Re: [BUGS] Excessive space allocations in Postgresql 9.1.6<BR>system files causing the file system to run out of space.<BR>From: Kevin Grittner &lt;<A href="mailto:kgrittn(at)ymail(dot)com">kgrittn(at)ymail(dot)com</A>&gt;<BR>Date: Wed, February 27, 2013 1:16 pm<BR>To: "<A href="mailto:fburgess(at)radiantblue(dot)com">fburgess(at)radiantblue(dot)com</A>" &lt;<A href="mailto:fburgess(at)radiantblue(dot)com">fburgess(at)radiantblue(dot)com</A>&gt;</div>
<div><BR>Please keep the list copied (use "Reply All").</div>
<div><BR>When you do that, please describe how you upgraded.&nbsp; Was it with pg_upgrade?&nbsp; Did you use the hard link option?&nbsp; Did you run the cleanup script afterward?</div>
<div><BR>-Kevin</div>
<div>--------------------------------------------------------------------------------<BR>From: "<A href="mailto:fburgess(at)radiantblue(dot)com">fburgess(at)radiantblue(dot)com</A>" &lt;<A href="mailto:fburgess(at)radiantblue(dot)com">fburgess(at)radiantblue(dot)com</A>&gt;<BR>To: Kevin Grittner &lt;<A href="mailto:kgrittn(at)ymail(dot)com">kgrittn(at)ymail(dot)com</A>&gt; <BR>Sent: Wednesday, February 27, 2013 2:08 PM<BR>Subject: RE: [BUGS] Excessive space allocations in Postgresql 9.1.6 system files causing the file system to run out of space.</div>
<div>&nbsp;</div>
<div>I am looking in a variety of directories which include<BR>&nbsp;<BR>/opt/PostgreSQL/9.1/data/global<BR>/opt/PostgreSQL/9.1/data/base/16411<BR>/opt/PostgreSQL/9.1/data/user_data/PG_9.1_201105231/16411<BR>/opt/PostgreSQL/9.1/data/user_data/PG_9.1_201105231/16416<BR>/opt/PostgreSQL/9.1/data/user_data/19177<BR>/opt/PostgreSQL/9.1/data/track_data/year2010/19177<BR>/opt/PostgreSQL/9.1/data/track_data/year2010/PG_9.1_201105231/16411<BR>/opt/PostgreSQL/9.1/data/track_data/year2011/19177<BR>/opt/PostgreSQL/9.1/data/track_data/year2011/PG_9.1_201105231/16411<BR>/opt/PostgreSQL/9.1/data/track_data/year2012/19177<BR>/opt/PostgreSQL/9.1/data/track_data/year2012/PG_9.1_201105231/16411<BR>/opt/PostgreSQL/9.1/data/track_data/year2013/PG_9.1_201105231/16411<BR>/opt/PostgreSQL/9.1/data/track_data/year_underflow/19177<BR>/opt/PostgreSQL/9.1/data/track_data/year_underflow/PG_9.1_201105231/16411<BR>&nbsp;<BR>Everything in the .../19177 directories represent data files migrated over form postgres 8.4.3.&nbsp; All new files get placed into the .../PG_9.1_201105231/16411 directories.<BR>&nbsp;<BR>Yes, I exclude all files derived from pg_class that include an underscore or period.<BR>&nbsp;<BR>The vast majority of the "orphan" files are from the /opt/PostgreSQL/9.1/data/user_data/19177&nbsp; directory. <BR>&nbsp;<BR>thanks<BR>&nbsp;<BR>-------- Original Message --------<BR>Subject: Re: [BUGS] Excessive space allocations in Postgresql 9.1.6<BR>system files causing the file system to run out of space.<BR>From: Kevin Grittner &lt;<A href="mailto:kgrittn(at)ymail(dot)com">kgrittn(at)ymail(dot)com</A>&gt;<BR>Date: Wed, February 27, 2013 8:55 am<BR>To: "<A href="mailto:fburgess(at)radiantblue(dot)com">fburgess(at)radiantblue(dot)com</A>" &lt;<A href="mailto:fburgess(at)radiantblue(dot)com">fburgess(at)radiantblue(dot)com</A>&gt;, <BR>"<A href="mailto:pgsql-bugs(at)postgresql(dot)org">pgsql-bugs(at)postgresql(dot)org</A>" &lt;<A href="mailto:pgsql-bugs(at)postgresql(dot)org">pgsql-bugs(at)postgresql(dot)org</A>&gt;</div>
<div>"<A href="mailto:fburgess(at)radiantblue(dot)com">fburgess(at)radiantblue(dot)com</A>" &lt;<A href="mailto:fburgess(at)radiantblue(dot)com">fburgess(at)radiantblue(dot)com</A>&gt; wrote:</div>
<div>&gt; We have a Postgres database that was recently upgraded from 8.4.3<BR>&gt; to 9.1.6.&nbsp; We have noticed unusual growth in the data files and<BR>&gt; generated a script to perform the following actions.</div>
<div>&gt; 1. Query pg_class for all records<BR>&gt; 2. Generate a file listing of all postgres data files<BR>&gt; 3. Compare the two lists and eliminate all files that are<BR>&gt;&nbsp;&nbsp;&nbsp; contained within pg_class<BR>&gt; <BR>&gt; There are 17359 data files.&nbsp; After running the script, there are<BR>&gt; 5802 data files remaining that are not listed in pg_class.&nbsp; Due<BR>&gt; to the size of the (5802) data files (~4TB), I am not comfortable<BR>&gt; about deleting them from the file system.&nbsp; Does postgres 9.1.6<BR>&gt; catalog every data file in pg_class?&nbsp;&nbsp; Or does it leave some data<BR>&gt; files off of this table?&nbsp; If so, how can I determine if I have<BR>&gt; stale, unnecessary data files on my file system?</div>
<div>Yeah, it's good to be cautious -- deleting a needed file can render<BR>your database cluster unusable.&nbsp; Be sure you have a good backup you<BR>can go back to if you delete the wrong thing.</div>
<div>What directories are you looking in?</div>
<div>For a database or tablespace directory, are you excluding all files<BR>which start with a filename you derived from pg_class and has a dot<BR>or underscore followed by more characters?</div>
<div>--<BR>Kevin Grittner<BR>EnterpriseDB: <A href="http://www.enterprisedb.com">http://www.enterprisedb.com</A><BR>The Enterprise PostgreSQL Company</div>
<div><BR>&nbsp;-------- Original Message --------<BR>Subject: Re: [BUGS] Excessive space allocations in Postgresql 9.1.6<BR>system files causing the file system to run out of space.<BR>From: Andres Freund &lt;<a href="mailto:andres(at)2ndquadrant(dot)com">andres(at)2ndquadrant(dot)com</a>&gt;<BR>Date: Thu, February 28, 2013 12:23 pm<BR>To: <a href="mailto:fburgess(at)radiantblue(dot)com">fburgess(at)radiantblue(dot)com</a><BR><BR>Hi,<BR><BR>On 2013-02-27 14:21:44 -0700, <a href="mailto:fburgess(at)radiantblue(dot)com">fburgess(at)radiantblue(dot)com</a> wrote:<BR>&gt; &lt;html&gt;&lt;body&gt;&lt;span style="font-family:Verdana; color:#000000; font-size:10pt;"&gt;&lt;div&gt;We did use pg_upgrade with the hard link option. We are not sure if we ran the cleanup script. &lt;/div&gt; ...<BR>&gt; OTE&gt;&lt;/span&gt;&lt;/body&gt;&lt;/html&gt;<BR><BR>youre more likely to get help if you send your emails either in<BR>plain-text only or at least plain-text &amp; html...<BR><BR>Greetings,<BR><BR>Andres Freund<BR><BR>-- <BR>Andres Freund <a href="http://www.2ndQuadrant.com">http://www.2ndQuadrant.com</a>/<BR>PostgreSQL Development, 24x7 Support, Training &amp; Services<BR></div></span></body></html>

Attachment Content-Type Size
unknown_filename text/html 7.5 KB

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Grittner 2013-03-01 16:00:30 Re: Excessive space allocations in Postgresql 9.1.6 system files causing the file system to run out of space.
Previous Message Jon Nelson 2013-03-01 15:15:43 8.4: COPY continues after client disconnects