recovery_command has precedence over phisical slots?

From: Giovanni Biscontini <biscontini(dot)g(at)es2000(dot)it>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: recovery_command has precedence over phisical slots?
Date: 2022-08-19 14:54:58
Message-ID: CAOM+UfWii7Dp_1Q8jjEm4zFe1vjsj9erXBKe+6hoCU++Snyq+Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello everyone,
I'm experiencing a behaviour I don't really understand if is a
misconfiguration or a wanted behaviour:
1) I set up a primary server (a.k.a. db1) with and archive_command to a
storage
2) I set up a replica (a.k.a. db2) that created a slot named as slot_2 and
that has the recovery_command set to read archived wal on the storage.
If I shutdown replica db2 during a pgbench I see the safe_wal_size queried
from pg_replication_slots on the primary decrease to a certain amount but
still in the max_slot_wal_kepp_size window: even if I restart the replica
db2 before the slot_state changes to unreserved or lost I see that the
replica gets needed wals from the storage using recovery_command but
doesn't use slot on primary.
Only if I comment the recovery command on the .conf of the replica then it
uses slot.
If this is a wanted behaviour I can't understand the need of slots on
primary.
Hopin' could someone explain me, thanks in advance, Giovanni

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marco Schmucki 2022-08-19 15:09:35 High Availability PostgresDB on K8s
Previous Message Vido Vlahinic 2022-08-19 07:52:15 RE: Monitoring multixact members growth