Re: RDS restore failed due to WAL log and disk space-- any tidy fixes? - Mailing list pgsql-admin

From Laurenz Albe
Subject Re: RDS restore failed due to WAL log and disk space-- any tidy fixes?
Date
Msg-id 14770c231bf27ea6d22376395ac8f02e41462ed5.camel@cybertec.at
Whole thread Raw
In response to RDS restore failed due to WAL log and disk space-- any tidy fixes?  (Wells Oliver <wells.oliver@gmail.com>)
Responses Re: RDS restore failed due to WAL log and disk space-- any tidy fixes?
List pgsql-admin
On Sat, 2024-11-16 at 16:33 -0800, Wells Oliver wrote:
> I provisioned an RDS instance with 2500GB space and began the restore of a database I know to be about 1750 GB using
16jobs. 
>
> Unfortunately, it died very near the end when it ran out of disk space due to WAL log usage. Lots of:
>
> 2024-11-17 00:07:09 UTC::@:[19861]:PANIC:  could not write to file "pg_wal/xlogtemp.19861": No space left on device
>
>
> And then kaboom.
>
> I'm wondering what my course of action should be. Can I disable/reduce WAL during a restore?
> wal_level is set to replica, can this temporarily be set to minimal? Should I just eat the extra
> costs to add headroom for the WAL? Would using fewer jobs during a restore reduce the amount of WAL
> created?

If you are using minimal WAL logging and you restore the dump in a single transaction, you
should see way less WAL generated, because data inserted into the table in the same transaction
as the CREATE TABLE statement need not be WAL logged.

But you might more easily solve the problem by speeding up or disabling the WAL archiver,
so that PostgreSQL removes old WAL after the next checkpoint.

Yours,
Laurenz Albe



pgsql-admin by date:

Previous
From: Wells Oliver
Date:
Subject: RDS restore failed due to WAL log and disk space-- any tidy fixes?
Next
From: Wells Oliver
Date:
Subject: Re: RDS restore failed due to WAL log and disk space-- any tidy fixes?