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)

相关文章

来源:http://www.postgres.cn/docs/11/ 4.1.1. 标识符和关键词 SQL标识符和关键词必须以一个...
来源:http://www.postgres.cn/docs/11/ 8.1. 数字类型 数字类型由2、4或8字节的整数以及4或8...
来源:http://www.postgres.cn/docs/11/ 5.1. 表基础 SQL并不保证表中行的顺序。当一个表被读...
来源:http://www.postgres.cn/docs/11/ 6.4. 从修改的行中返回数据 有时在修改行的操作过程中...
来源:http://www.postgres.cn/docs/11/ 13.2.1. 读已提交隔离级别 读已提交是PostgreSQL中的...
来源:http://www.postgres.cn/docs/11/ 9.7. 模式匹配 PostgreSQL提供了三种独立的实现模式匹...