Re: pg ignores wal files in pg_wal, and instead tries to load them from archive/primary

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: depesz(at)depesz(dot)com
Cc: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: pg ignores wal files in pg_wal, and instead tries to load them from archive/primary
Date: 2022-10-01 21:44:36
Message-ID: CAMkU=1z2AeiruX-NWxyuMaQXGSXuNUpTaFC1paODkmXYLrMXhw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

>
>
> Currently our goto fix is:
> 1. increase wal_keep_size to ~ 200GB
> 2. standaup replica
> 3. once it catches up decrease wal_keep_size to standard (for us) 16GB
>
> but it is not really nice solution.
>

If you don't have an archive and aren't using a permanent slot, then you
always have the risk of blowing past your available WAL.

Increasing wal_keep_size is an option to reduce this risk. Yes, it is not
so nice, but you have already declined to use the nicer options.

Where those extra unusable files came from is a curiosity, but nothing more
than that. I'm guessing they were created by the wrapper you said you use,
as I can't reproduce their existence with just pg_basebackup. They are
probably "recycled ahead" files from the master that somehow got copied
needlessly, and with a file name which does not match the file contents
(since they contents are from a previous name the file had). pg_waldump
isn't as helpful as it could be in those cases.

Cheers,

Jeff

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2022-10-01 23:04:40 Re: Bug / Unintentional Feature: non-immutable functions can be used for generated columns.
Previous Message Shane Plesner 2022-10-01 21:44:31 Re: Bug / Unintentional Feature: non-immutable functions can be used for generated columns.