PostgreSQL啟動恢復透過checkpoint open wal檔案

yzs87發表於2018-08-04
StartupLOG::
->record = ReadCheckpointRecord(xlogreader, ControlFile->checkPoint, 1, true)
->record = ReadRecord(xlogreader, ControlFile->checkPoint, LOG, true)
->record = XLogReadRecord(xlogreader, ControlFile->checkPoint, &errormsg);
->readOff = ReadPageInternal(state,ControlFile->checkPoint - (ControlFile->checkPoint % XLOG_BLCKSZ), Min(ontrolFile->checkPoint % XLOG_BLCKSZ + SizeOfXLogRecord, XLOG_BLCKSZ));
->|--pageptr=ControlFile->checkPoint - (ControlFile->checkPoint % XLOG_BLCKSZ)
  |--targetPageOff = (pageptr % XLogSegSize);//段檔案偏移
  |--targetSegmentPtr = pageptr - targetPageOff;
  |--readLen = state->read_page(state, targetSegmentPtr(0?), XLOG_BLCKSZ,ControlFile->checkPoint, state->readBuf, &state->readPageTLI);
->WaitForWALToBecomeAvailable(targetSegmentPtr(0?) + XLOG_BLCKSZ,private->randAccess,1,targetRecPtr)
->readFile = XLogFileReadAnyTLI(targetSegmentPtr/XLogSegSize, DEBUG2,currentSource == XLOG_FROM_ARCHIVE ? XLOG_FROM_ANY :currentSource)
->fd = XLogFileRead(segno, emode, tli,XLOG_FROM_ARCHIVE或者XLOG_FROM_PG_WAL, true)
->fd = BasicOpenFile(path, O_RDONLY | PG_BINARY, 0);
->fd = open(fileName, fileFlags, fileMode)


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31493717/viewspace-2199170/,如需轉載,請註明出處,否則將追究法律責任。

相關文章