ITPub博客

首页 > 数据库 > PostgreSQL > PostgreSQL启动恢复通过checkpoint open wal文件

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

原创 PostgreSQL 作者:yzs87 时间:2018-08-04 20:57:18 0 删除 编辑
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博客 ” ,链接:https://blog.itpub.net/31493717/viewspace-2199170/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
专注于MySQL、Aerospike、PostgreSQL数据库

注册时间:2017-10-03

  • 博文量
    149
  • 访问量
    285473