Postgres Streaming Replication: How to re-sync data in master (with standby) after failover
During the process there is a good chance that the process fails requesting wall files that have never existed in the old time line. That does not help quickly restoring the requested redundancy.
The safest method is to just create a fresh new replica.
So if your requirement is to always have at least one valid replica, make sure you have two of them. This gives you time to rebuild the former primary as a new replica and still keep operating at your requested redundancy level.
There was a bug that is solved in 9.5.22 that caused premature recycling of wall files during crash recovery.