Checkpoint原理浅析(12页).pdf

编号:86222 PDF 12页 1.52MB 下载积分:VIP专享
下载报告请您先登录!

Checkpoint原理浅析(12页).pdf

1、Checkpoint原理浅析杨向博 DBACheckpoint 定义Checkpoint 触发条件Checkpoint 会做什么Checkpoint skipped机制Checkpoint 过程记录Checkpoint 定义Checkpointsarepointsinthesequenceoftransactionsatwhichitisguaranteedthattheheapandindexdatafileshavebeenupdatedwithallinformationwrittenbeforethatcheckpoint.Atcheckpointtime,alldirtydatapa

2、gesareflushedtodiskandaspecialcheckpointrecordiswrittentothelogfile.(ThechangerecordswerepreviouslyflushedtotheWALfiles.)Intheeventofacrash,thecrashrecoveryprocedurelooksatthelatestcheckpointrecordtodeterminethepointinthelog(knownastheredorecord)fromwhichitshouldstarttheREDOoperation.Anychangesmadet

3、odatafilesbeforethatpointareguaranteedtobealreadyondisk.Hence,afteracheckpoint,logsegmentsprecedingtheonecontainingtheredorecordarenolongerneededandcanberecycledorremoved.(WhenWALarchivingisbeingdone,thelogsegmentsmustbearchivedbeforebeingrecycledorremoved.)简单来说,checkpoint就是一个事务顺序的记录点。checkpoint主要是进

4、行刷脏页,redo时会参考checkpoint进行日志回放。除了刷脏之外还会更新一些位点信息,清理一些不再需要的wal。Checkpoint 触发条件在PostgreSQL中Checkpoint是由checkpointer进程执行的。Checkpointer进程的主流程是一个无条件的for循环,在未触发checkpoint时一直在WaitLatch中sleep,也就是在epoll_wait中观察list链表,查看是否有事件句柄已经就绪(某个条件在触发checkpoint);如果已经存在就绪事件,则wakeup(通过SetLatch中writepipe的方式wakeup),执行checkpoin

5、t。Checkpoint 触发条件触发checkpoint的Flags:/*ThesedirectlyaffectthebehaviorofCreateCheckPointandsubsidiaries*/#defineCHECKPOINT_IS_SHUTDOWN0 x0001/*Checkpointisforshutdown*/#defineCHECKPOINT_END_OF_RECOVERY.0 x0002/*Likeshutdowncheckpoint,but*issuedatendofWALrecovery*/#defineCHECKPOINT_IMMEDIATE0 x0004/*Do

6、itwithoutdelays*/#defineCHECKPOINT_FORCE0 x0008/*Forceevenifnoactivity*/#defineCHECKPOINT_FLUSH_ALL0 x0010/*Flushallpages,includingthose*belongingtounloggedtables*/*TheseareimportanttoRequestCheckpoint*/#defineCHECKPOINT_WAIT0 x0020/*Waitforcompletion*/#defineCHECKPOINT_REQUESTED0 x0040/*Checkpointr

友情提示

1、下载报告失败解决办法
2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
4、本站报告下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。

本文(Checkpoint原理浅析(12页).pdf)为本站 (云闲) 主动上传,三个皮匠报告文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三个皮匠报告文库(点击联系客服),我们立即给予删除!

温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。
客服
商务合作
小程序
服务号
折叠