PostgreSQL启动恢复通过checkpoint open wal文件

前端之家收集整理的这篇文章主要介绍了PostgreSQL启动恢复通过checkpoint open wal文件前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
StartupLOG::
->record = ReadCheckpointRecord(xlogreader,ControlFile->checkPoint,1,true)
->record = ReadRecord(xlogreader,LOG,true)
->record = XLogReadRecord(xlogreader,&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,state->readBuf,&state->readPageTLI);
->WaitForWALToBecomeAvailable(targetSegmentPtr(0?) + XLOG_BLCKSZ,private->randAccess,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)

猜你在找的Postgre SQL相关文章