Hello,
I am looking to better understand the thought behind a replication slot's restart_lsn initialization. Currently in 9.4 and master, a replication slot's restart_lsn is set to InvalidXLogRecPtr and will only start tracking restart_lsn once a walreceiver has confirmed receipt of an lsn.
Was there any consideration for initializing restart_lsn to the latest WAL write pointer when a slot is created? Or for allowing an optional parameter in pg_create_(physical|logical)_replication_slot() for specifying the restart_lsn at slot creation?
I believe there are valid usage patterns where the user would like to start holding transaction logs from being removed/recycled during the time that the standby is being restored from base backup. Currently this can be worked around by using pg_receivexlog immediately after creating the replication slot but it feels kind of hacky.
It is also strange that the return type for pg_create_(physical|logical)_replication_slot includes xlog_position but as far as I can tell, it will never contain a value. Is this intended for something in the future?
Thanks,
Danilo