On Thu, Dec 7, 2023 at 8:00 AM Zhijie Hou (Fujitsu) <houzj.f...@fujitsu.com> wrote: > After looking closer, it seems this behavior started from 15f8203 which > introduced the > ReplicationSlotInvalidationCause 'invalidated', after that we check the > invalidated enum > in Xmin/Lsn computation function.
Adding Andres in Cc, as that was his commit. It's not entirely clear to me how this feature was intended to interact with physical replication slots. I found seemingly-relevant documentation in two places: https://www.postgresql.org/docs/current/runtime-config-replication.html#GUC-MAX-SLOT-WAL-KEEP-SIZE https://www.postgresql.org/docs/current/view-pg-replication-slots.html In the latter, it says "unreserved means that the slot no longer retains the required WAL files and some of them are to be removed at the next checkpoint. This state can return to reserved or extended." But if a slot becomes invalid in such a way that it cannot return to a valid state later, then this isn't accurate. I have a feeling that the actual behavior here has evolved and the documentation hasn't kept up. And I wonder whether we need a more comprehensive explanation of the intended behavior in this section: https://www.postgresql.org/docs/current/warm-standby.html#STREAMING-REPLICATION-SLOTS -- Robert Haas EDB: http://www.enterprisedb.com