Re: filesystem full during vacuum - space recovery issues

From: Paul Smith* <paul(at)pscs(dot)co(dot)uk>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: filesystem full during vacuum - space recovery issues
Date: 2024-07-18 15:19:31
Message-ID: ef82293d-b970-4678-ba18-ed1560a6922b@pscs.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

On 15/07/2024 19:47, Thomas Simpson wrote:
>
> My problem now is how do I get this space back to return my free space
> back to where it should be?
>
> I tried some scripts to map the data files to relations but this
> didn't work as removing some files led to startup failure despite them
> appearing to be unrelated to anything in the database - I had to put
> them back and then startup worked.
>
I don't know what you tried to do

What would normally happen on a failed VACUUM FULL that fills up the
disk so the server crashes is that there are loads of data files
containing the partially rebuilt table. Nothing 'internal' to PostgreSQL
will point to those files as the internal pointers all change to the new
table in an ACID way, so you should be able to delete them.

You can usually find these relatively easily by looking in the relevant
tablespace directory for the base filename for a new huge table (lots
and lots of files with the same base name - eg looking for files called
*.1000 will find you base filenames for relations over about 1TB) and
checking to see if pg_filenode_relation() can't turn the filenode into a
relation. If that's the case that they're not currently in use for a
relation, then you should be able to just delete all those files

Is this what you tried, or did your 'script to map data files to
relations' do something else? You were a bit ambiguous about that part
of things.

Paul

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Veerendra Pulapa 2024-07-18 15:33:48 Seeking Insights on Choosing the Right CPU and RAM for PostgreSQL Setup
Previous Message Ron Johnson 2024-07-18 15:16:05 Re: filesystem full during vacuum - space recovery issues

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-07-18 16:27:27 Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal
Previous Message Ron Johnson 2024-07-18 15:16:05 Re: filesystem full during vacuum - space recovery issues