Regarding the archive_cleanup_command
command, the Postgresql 9.6 documentation states the following:
Note however that if multiple standby servers are restoring from the same archive directory, you will need to ensure that you do not delete WAL files until they are no longer needed by any of the servers.
Is there a built-in way that the master can know when all of the slaves do not need particular WAL files? Or does that functionality need to be added via scripting or other mechanism? If so, what would that look like?
Also, would it be typical to have an archive_cleanup_command
on both the master and the slaves, or would the slaves even be archiving?