After that introduction to synchronous replication and dynamically adjustable durability, I want to focus on a feature called the replication slots.
What is the purpose of a replication slot? Let's consider the following example: There is a master and a slave. On the master, a large transaction is executed and the network connection is not fast enough to ship all of the data in time. At some point, the master removes its transaction log (checkpoint). If the slave is too far behind, a resync is needed. As we have already seen, the wal_keep_segments setting can be used to reduce the risk of failing replication. The question is this: what is the best value for the wal_keep_segments setting? Sure, more is better, but how much is best?
Replication slots will solve this problem for us: if we are using a replication slot, a master can only recycle...