You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Delay reading timeline history file until it's fetched from master.
Streaming replication can fetch any missing timeline history files from the
master, but recovery would read the timeline history file for the target
timeline before reading the checkpoint record, and before walreceiver has
had a chance to fetch it from the master. Delay reading it, and the sanity
checks involving timeline history, until after reading the checkpoint
record.
There is at least one scenario where this makes a difference: if you take
a base backup from a standby server right after a timeline switch, the
WAL segment containing the initial checkpoint record will begin with an
older timeline ID. Without the timeline history file, recovering that file
will fail as the older timeline ID is not recognized to be an ancestor of
the target timeline. If you try to recover from such a backup, using only
streaming replication to fetch the WAL, this patch is required for that to
work.
(errmsg("requested timeline %u is not a child of this server's history",
5302
-
recoveryTargetTLI),
5303
-
errdetail("Latest checkpoint is at %X/%X on timeline %u, but in the history of the requested timeline, the server forked off from that timeline at %X/%X",
5304
-
(uint32) (ControlFile->checkPoint >> 32),
5305
-
(uint32) ControlFile->checkPoint,
5306
-
ControlFile->checkPointCopy.ThisTimeLineID,
5307
-
(uint32) (switchpoint >> 32),
5308
-
(uint32) switchpoint)));
5309
-
}
5310
-
5311
-
/*
5312
-
* The min recovery point should be part of the requested timeline's
5313
-
* history, too.
5314
-
*/
5315
-
if (!XLogRecPtrIsInvalid(ControlFile->minRecoveryPoint) &&
(errmsg("requested timeline %u is not a child of this server's history",
5441
+
recoveryTargetTLI),
5442
+
errdetail("Latest checkpoint is at %X/%X on timeline %u, but in the history of the requested timeline, the server forked off from that timeline at %X/%X",
5443
+
(uint32) (ControlFile->checkPoint >> 32),
5444
+
(uint32) ControlFile->checkPoint,
5445
+
ControlFile->checkPointCopy.ThisTimeLineID,
5446
+
(uint32) (switchpoint >> 32),
5447
+
(uint32) switchpoint)));
5448
+
}
5449
+
5450
+
/*
5451
+
* The min recovery point should be part of the requested timeline's
5452
+
* history, too.
5453
+
*/
5454
+
if (!XLogRecPtrIsInvalid(ControlFile->minRecoveryPoint) &&
0 commit comments