In the previous recipe, Promoting a standby in a replication cluster with multiple standby servers, and also in the recipe Promoting a standby to a master, we discussed how a standby server can be promoted in the event of failover for disaster recovery. In this recipe, we shall discuss how the old master that has diverged from the replication cluster can be added back to the cluster as a standby, without rebuilding it from scratch.
Getting ready...
This works for a replication cluster on which a failover has been performed. Additionally, it only works when either the parameter wal_log_hints or data_checksums is enabled. Setting both these parameters may add some performance penalty, however, with wal_log_hints incurring less overhead.
wal_log_hints: When this parameter is active, the PostgreSQL server writes the entire content of each disk page to WAL during the first modification of that page after a checkpoint, even for non-critical...