[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: Table space not returned to the OS ?
From:       Magnus Hagander <magnus () hagander ! net>
Date:       2022-06-27 14:33:35
Message-ID: CABUevEwiPoP6ipaOaPmW770uVM2QXaV5ZgAjx6J18x0h_STd5Q () mail ! gmail ! com
[Download RAW message or body]

On Mon, Jun 27, 2022 at 12:01 PM Laurenz Albe <laurenz.albe@cybertec.at>
wrote:

> On Mon, 2022-06-27 at 11:38 +0200, Magnus Hagander wrote:
> > On Mon, Jun 27, 2022 at 11:30 AM Florents Tselai <
> florents.tselai@gmail.com> wrote:
> > > A few months back (October) I had upgraded a Postgres instance from
> v12 —> 14.
> > >
> > > The database disk size under /var/lib/postgresql/12 was around 800GB+
> back then.
> > > Note, that IIRC I had used hard-linking during the upgrade.
> > >
> > > As I was running out of disk space, I started investigating and found
> out that
> > >
> > > /var/lib/postgresql/12/main/base/16385  —>  886GB+
> > > /var/lib/postgresql/14 —> 400GB
> >
> > It looks like you didn't actually delete the old cluster, which you are
> supposed
> > to do once you have verified that the new one works.
>
> I think that it should be done earlier than that, namely immediately after
> running
> pg_upgrade.  Once you have started the PostgreSQL 14 server (to verify
> that it works),
> you can no longer use the old cluster.
> Yes, the control file is crippled, but in my opinion, the earlier you
> delete the old
> cluster, the safer.
>

I'd say there is still some recoverable data in the old cluster files, even
if you can't just start up the cluster in it. But yes, it comes down to how
you define "verified that the new one works" to some level.

-- 
 Magnus Hagander
 Me: https://www.hagander.net/ <http://www.hagander.net/>
 Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

[Attachment #3 (text/html)]

<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">On Mon, Jun 27, 2022 at 12:01 PM Laurenz Albe &lt;<a \
href="mailto:laurenz.albe@cybertec.at">laurenz.albe@cybertec.at</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, 2022-06-27 at \
11:38 +0200, Magnus Hagander wrote:<br> &gt; On Mon, Jun 27, 2022 at 11:30 AM \
Florents Tselai &lt;<a href="mailto:florents.tselai@gmail.com" \
target="_blank">florents.tselai@gmail.com</a>&gt; wrote:<br> &gt; &gt; A few months \
back (October) I had upgraded a Postgres instance from v12 —&gt; 14.<br> &gt; &gt; \
<br> &gt; &gt; The database disk size under /var/lib/postgresql/12 was around 800GB+ \
back then.<br> &gt; &gt; Note, that IIRC I had used hard-linking during the \
upgrade.<br> &gt; &gt; <br>
&gt; &gt; As I was running out of disk space, I started investigating and found out \
that <br> &gt; &gt; <br>
&gt; &gt; /var/lib/postgresql/12/main/base/16385   —&gt;   886GB+ <br>
&gt; &gt; /var/lib/postgresql/14 —&gt; 400GB<br>
&gt; <br>
&gt; It looks like you didn&#39;t actually delete the old cluster, which you are \
supposed<br> &gt; to do once you have verified that the new one works.<br>
<br>
I think that it should be done earlier than that, namely immediately after \
running<br> pg_upgrade.   Once you have started the PostgreSQL 14 server (to verify \
that it works),<br> you can no longer use the old cluster.<br>
Yes, the control file is crippled, but in my opinion, the earlier you delete the \
old<br> cluster, the safer.<br></blockquote><div><br></div><div>I&#39;d say there is \
still some recoverable data in the old cluster files, even if you can&#39;t just \
start up the cluster in it. But yes, it comes down to how you define &quot;verified \
that the new one works&quot; to some level.  </div></div><div><br></div>-- <br><div \
dir="ltr" class="gmail_signature"><div dir="ltr"><div>  Magnus Hagander<br>  Me: <a \
href="http://www.hagander.net/" target="_blank">https://www.hagander.net/</a><br>  \
Work: <a href="http://www.redpill-linpro.com/" \
target="_blank">https://www.redpill-linpro.com/</a></div></div></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic