初步學習pg control檔案之六

2021-09-06 11:18:57 字數 1719 閱讀 6698

接前文:初步學習pg_control檔案之五 ,db_in_archive_recovery何時出現?

看**:如果recovery.conf檔案存在,則返回 inarchiverecovery = true。

/*

* see if there is a recovery command file (recovery.conf), and if so

* read in parameters for archive recovery and xlog streaming.

* the file is parsed using the main configuration parser. */

static

void

readrecoverycommandfile(

void

)

/*enable fetching from archive recovery area

*/inarchiverecovery = true

;

}

然後,如果pg_control檔案的state不是 db_shutdowned狀態,則可以認為需要recovery,

此時,如果 inarchiverecovery 為true,則開始設定db_in_archive_recovery 狀態。

/*

* this must be called once during postmaster or standalone-backend startup */

void

startupxlog(

void

)

else

if (controlfile->state !=db_shutdowned)

inrecovery = true

;

else

if(inarchiverecovery)

/*redo

*/if

(inrecovery)

updatecontrolfile();

}

}

初步學習pg control檔案之三

接前文,初步學習pg control檔案之二 繼續學習 研究 dbstate,先研究 db in production 看它如何出現 它出現在啟動postmaster時執行的函式處 this must be called once during postmaster or standalone ba...

spring學習初步

package cn.bupt.duming.service public inte ce greetingservice 儘管看起來,在此處沒必要隱藏介面,但是我們還是建議將實現與介面分離。public class greetingserviceimpl implements greetingse...

perl 學習初步

前天開始學習perl語言,因為perl的應用實在是太廣泛了 第一步搭建環境,在linux下基本上都自帶了perl直譯器,很一般的目錄是 usr bin perl 也有是在 usr local bin perl的下面 只要通過在終端中輸入perl v就會顯示perl相關的版本資訊了,如果是5.0版本一...