From: | Guillaume Lelarge <guillaume(at)lelarge(dot)info> |
---|---|
To: | Pierre Barre <pierre(at)barre(dot)sh> |
Cc: | "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
Subject: | Re: VACUUM FULL, power failure results in unrecoverable space |
Date: | 2024-12-03 06:13:20 |
Message-ID: | CAECtzeVZ1C_CmK_AxMV1B5VdhKRoH3DV7zu9Omr0yCijHQXa+g@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi,
Le mar. 3 déc. 2024, 01:02, Pierre Barre <pierre(at)barre(dot)sh> a écrit :
> Hello,
>
> I encountered an issue while attempting to reclaim space from a heavily
> bloated table:
>
> Initial analysis using
> https://github.com/ioguix/pgsql-bloat-estimation/blob/master/table/table_bloat.sql indicated
> approximately 600GB of bloat in the table.
>
> I initiated a VACUUM FULL operation to reclaim this space, but during
> execution, the server experienced a power failure.
>
>
> After server recovery:
>
> 1. The database came back online successfully
> 2. The space used by the in-progress table reconstruction was not freed
>
Because doesn't know it's here.
3. The newly wasted space (bloat + partial VACUUM FULL) is not shown using
> the above query, only the initial bloat.
>
Because it's not the same kind of bloat. Vacuum full builds another set of
files for the table, and these files aren't yet connected to the table,
since vacuum full didn't finish. You've got some orphaned files you'll have
to delete.
>
> Is there a way to reclaim this space without resorting to a full pg_dump
> and pg_restore cycle?
>
You can dump and restore (which will drop all bloat of this database), but
will probably take too long to finish. You can also see pg_orphaned to know
which files to delete (https://github.com/bdrouvot/pg_orphaned)
Regards.
--
Guillaume.
From | Date | Subject | |
---|---|---|---|
Next Message | Tefft, Michael J | 2024-12-03 16:32:22 | Autovacuum and visibility maps |
Previous Message | Adrian Klaver | 2024-12-03 05:28:36 | Re: Help in vetting my steps for Postgres DB upgrade from Ver 13.X to ver 15.X |