溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》
  • 首頁 > 
  • 教程 > 
  • 數據庫 > 
  • PostgreSQL啟動恢復期間,恢復到的時間線的確定

PostgreSQL啟動恢復期間,恢復到的時間線的確定

發布時間:2020-07-18 11:56:03 來源:網絡 閱讀:1279 作者:yzs的專欄 欄目:數據庫

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;
		}
	}


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女