您好,登錄后才能下訂單哦!
1、啟動恢復時,確定恢復到的時間線recoveryTargetTLI
1)歸檔恢復點比checkpoint中記錄的時間線大,那么選擇歸檔恢復點作為目標時間線
2)否則,checkpoint記錄中的時間線作為目標時間線
StartupXLOG-> if (ControlFile->minRecoveryPointTLI > ControlFile->checkPointCopy.ThisTimeLineID) recoveryTargetTLI = ControlFile->minRecoveryPointTLI; else recoveryTargetTLI = ControlFile->checkPointCopy.ThisTimeLineID; ...
2、接著從recovery.conf文件中讀取
1)若設置了recovery_target_timeline值,并且設為latest,那么history列表最大的時間線即為目標時間線
2)否則是recovery.conf文件中設置的時間線值
3)若沒有設置recovery_target_timeline值,則目標時間線為第一步中的值
StartupXLOG->readRecoveryCommandFile()-> for (item = head; item; item = item->next){ if (strcmp(item->name, "restore_command") == 0){ ... }else if ... 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); }else if... } if (rtliGiven){ if (rtli){ recoveryTargetTLI = rtli; recoveryTargetIsLatest = false; }else{ /* We start the "latest" search from pg_control's timeline */ recoveryTargetTLI = findNewestTimeLine(recoveryTargetTLI); recoveryTargetIsLatest = true; } }
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。