码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2018-08-04 21:44:05      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:ESS   ble   logfile   bin   post   ntp   tar   ==   code   

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)

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

标签:ESS   ble   logfile   bin   post   ntp   tar   ==   code   

原文地址:http://blog.51cto.com/yanzongshuai/2154768

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!