Patroni, slots, and expiring WALs - Mailing list pgsql-general

From Peter J. Holzer
Subject Patroni, slots, and expiring WALs
Date
Msg-id 20230328145508.g6kl3sek6ycijvsg@hjp.at
Whole thread Raw
Responses Re: Patroni, slots, and expiring WALs  (Jeremy Smith <jeremy@musicsmith.net>)
Re: Patroni, slots, and expiring WALs  (Alexander Kukushkin <cyberdemn@gmail.com>)
List pgsql-general
I think I'm missing something basic here.

We have set up a postgresql cluster with Patroni (3.0.1-1.pgdg22.04+1)
and PostgreSQL (15+248.pgdg22.04+1) from the PGDG repo fur Ubuntu.

The patroni configuration was created via the pg_createconfig_patroni
script, basically using all the defaults.

The configuration includes `use_slots: true` and I can see a slot in
pg_replication_slots on the leader.

I was under the impression that this would be sufficient to prevent WALs
from being deleted on the leader before they are used on the replica.

However, when we took down one node for about two hours for some tests
recently (with some moderate traffic on the remaining node), the replica
didn't catch up after being restarted and inspection of the logs showed
that it was trying to get WALs which had already been deleted.

So apparently, `use_slots: true` isn't enough. What else do I have to
configure? (I know about wal_keep_size, but it was my understanding that
this isn't needed when slots are used)

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachment

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Cluster table based on grand parent?
Next
From: Jeremy Smith
Date:
Subject: Re: Patroni, slots, and expiring WALs