As documentation said - restart_lsn
is:
The address (LSN) of oldest WAL which still might be required by the consumer of this slot and thus won't be automatically removed during checkpoints unless this LSN gets behind more than max_slot_wal_keep_size from the current LSN. NULL if the LSN of this slot has never been reserved.
And confirmed_flush_lsn
is:
The address (LSN) up to which the logical slot's consumer has confirmed receiving data. Data older than this is not available anymore. NULL for physical slots.
The thing i do not understand (in case of logical slots) is - how do this both properties connected to each other? confirmed_flush_lsn
description said that older logs are deleted, but restart_lsn
sound like it is not 100% right. If not and there is some number of transaction logs between restart_lsn
and confirmed_flush_lsn
- how much could this number be? Is it some predefined and immutable value, lets say several MBs or it could it really raise up to max_slot_wal_keep_size
? How it is decided - what WAL still might be required by the consumer
and what not?