您好,登錄后才能下訂單哦!
一、問題:requested timeline %u does not contain minimum recovery point %X/%X on timeline %u
該日志在代碼中的位置如下:
StartupXLOG:
if (!XLogRecPtrIsInvalid(ControlFile->minRecoveryPoint) &&
tliOfPointInHistory(ControlFile->minRecoveryPoint - 1, expectedTLEs) !=
ControlFile->minRecoveryPointTLI)
ereport(FATAL,
(errmsg("requested timeline %u does not contain minimum recovery point %X/%X on timeline %u",
recoveryTargetTLI,
(uint32) (ControlFile->minRecoveryPoint >> 32),
(uint32) ControlFile->minRecoveryPoint,
ControlFile->minRecoveryPointTLI)));
二、分析
recoveryTargetTLI這個值是什么呢?
1、改值在啟動恢復過程中變化如下:
StartupXLOG:
...
if (ControlFile->minRecoveryPointTLI > ControlFile->checkPointCopy.ThisTimeLineID)
recoveryTargetTLI = ControlFile->minRecoveryPointTLI;
else
recoveryTargetTLI = ControlFile->checkPointCopy.ThisTimeLineID;
readRecoveryCommandFile();
|-- for (item = head; item; item = item->next){
| ...
| else if (strcmp(item->name, "recovery_target_timeline") == 0){
| rtliGiven = true;
| if (strcmp(item->value, "latest") == 0)
| rtli = 0;
| else
| rtli = (TimeLineID) strtoul(item->value, NULL, 0);
| }
| ...
| }
| ...
| if (rtliGiven){
| if (rtli){
| recoveryTargetTLI = rtli;
| recoveryTargetIsLatest = false;
| }else{
| recoveryTargetTLI = findNewestTimeLine(recoveryTargetTLI);
| recoveryTargetIsLatest = true;
| }
|-- }
首先,pg_control文件記錄的最小恢復點時間線ControlFile->minRecoveryPointTLI會和pg_control文件記錄的checkpoint的的時間線?ControlFile->checkPointCopy.ThisTimeLineID比較,recoveryTargetTLI取兩者之間較大值。
然后readRecoveryCommandFile會讀取recovery.cnf文件,如果是主機則沒有recovery.cnf文件。recovery.cnf文件中recovery_target_timeline的值指定恢復到的時間線,如果是latest則時間線rtli為0否則為其指定值;如果rtli是指定值,則recoveryTargetTLI為指定值,否則從第一步獲取的recoveryTargetTLI值+1開始,看是否有其對于的history文件,找到最大時間線對于的history文件,recoveryTargetTLI為該時間線。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。