Uses page-based mechanism to ensure we’re using the correct timeline.
Tests are included to exercise the functionality using a cold disk-level copy of the master that's started up as a replica with slots intact, but the intended use of the functionality is with later features.
Craig Ringer, reviewed by Simon Riggs and Andres Freund
1148e22 Teach xlogreader to follow timeline switches
src/backend/access/transam/xlogutils.c | 215 +++++++++++++++++++--
src/backend/replication/logical/logicalfuncs.c | 8 +-
src/backend/replication/walsender.c | 11 +-
src/include/access/xlogreader.h | 16 ++
src/include/access/xlogutils.h | 3 +
src/test/recovery/Makefile | 2 +
.../recovery/t/010_logical_decoding_timelines.pl | 130 +++++++++++++
7 files changed, 365 insertions(+), 20 deletions(-)