Re: FW: vacuumlo

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ian Dauncey <Ian(dot)Dauncey(at)bankzero(dot)co(dot)za>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: FW: vacuumlo
Date: 2021-08-30 16:53:25
Message-ID: 1414881.1630342405@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

Ian Dauncey <Ian(dot)Dauncey(at)bankzero(dot)co(dot)za> writes:
> I did run the vacuumlo against the pg_largeobject table without any issues but afterwards I ran a vacuum full against this table which caused lots of issues.
> Because the vacuum full takes an exclusive lock (which was my first mistake as I did not stop the applications accessing the database) on the table I had all the applications hanging. The next issue was it started writing out WAL logs and in the end the file system which housed the Wal logs filled up causing the vacuum to fail.
> Now the issue I have here is that the vacuum full created a temporary table , and when it crashed this temporary table did not get deleted. I did rerun the vacuum full against the pg_largeobject table (and yes, I did stop all the applications first). It did complete successfully but it did not drop the previous temporary table. This table is taking close to 100 Gig of disk space.

I think you mean "file", not "temporary table". You're going to have
to remove the file by hand, likely, as there is not (I think) any live
reference to it in the catalogs. Do

select pg_relation_filenode(oid) from pg_class;

and then match up the numbers it prints out with the filenames you
find in the database's directory. You should find matches to everything
except the problem file(s). Once you've identified which is the orphaned
file, you can remove it. If there seem to be a lot of orphaned files
with different base names, STOP ... you probably are looking at the
wrong database or some other mistake. But if there's just one base name
that's not accounted for, and the sum of the sizes of the files with that
base name looks about right, then you've probably got it right.

I strongly suggest reading

https://www.postgresql.org/docs/current/storage.html

before you go messing with any files manually, so you know what
you are looking at.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Laurenz Albe 2021-08-30 17:15:07 Re: vacuumlo
Previous Message Ian Dauncey 2021-08-30 16:23:55 FW: vacuumlo

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2021-08-30 17:15:07 Re: vacuumlo
Previous Message Tom Lane 2021-08-30 16:42:39 Re: Can we get rid of repeated queries from pg_dump?