PostgreSQL问题分析1:时间线不一致
发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,一、问题:requested timeline %u does not contain minimum recovery point %X/%X on timeline %u该日志在代码中的位置如下:
千家信息网最后更新 2026年11月01日PostgreSQL问题分析1:时间线不一致
一、问题:requested timeline %u does not contain minimum recovery point %X/%X on timeline %u
该日志在代码中的位置如下:
StartupXLOG: if (!XLogRecPtrIsInvalid(ControlFile->minRecoveryPoint) && tliOfPointInHistory(ControlFile->minRecoveryPoint - 1, expectedTLEs) != ControlFile->minRecoveryPointTLI) ereport(FATAL, (errmsg("requested timeline %u does not contain minimum recovery point %X/%X on timeline %u", recoveryTargetTLI, (uint32) (ControlFile->minRecoveryPoint >> 32), (uint32) ControlFile->minRecoveryPoint, ControlFile->minRecoveryPointTLI)));二、分析
recoveryTargetTLI这个值是什么呢?
1、改值在启动恢复过程中变化如下:
StartupXLOG: ... if (ControlFile->minRecoveryPointTLI > ControlFile->checkPointCopy.ThisTimeLineID) recoveryTargetTLI = ControlFile->minRecoveryPointTLI; else recoveryTargetTLI = ControlFile->checkPointCopy.ThisTimeLineID; readRecoveryCommandFile(); |-- for (item = head; item; item = item->next){ | ... | else if (strcmp(item->name, "recovery_target_timeline") == 0){ | rtliGiven = true; | if (strcmp(item->value, "latest") == 0) | rtli = 0; | else | rtli = (TimeLineID) strtoul(item->value, NULL, 0); | } | ... | } | ... | if (rtliGiven){ | if (rtli){ | recoveryTargetTLI = rtli; | recoveryTargetIsLatest = false; | }else{ | recoveryTargetTLI = findNewestTimeLine(recoveryTargetTLI); | recoveryTargetIsLatest = true; | } |-- }首先,pg_control文件记录的最小恢复点时间线ControlFile->minRecoveryPointTLI会和pg_control文件记录的checkpoint的的时间线 ControlFile->checkPointCopy.ThisTimeLineID比较,recoveryTargetTLI取两者之间较大值。
然后readRecoveryCommandFile会读取recovery.cnf文件,如果是主机则没有recovery.cnf文件。recovery.cnf文件中recovery_target_timeline的值指定恢复到的时间线,如果是latest则时间线rtli为0否则为其指定值;如果rtli是指定值,则recoveryTargetTLI为指定值,否则从第一步获取的recoveryTargetTLI值+1开始,看是否有其对于的history文件,找到最大时间线对于的history文件,recoveryTargetTLI为该时间线。
文件
时间
问题
分析
最大
最小
较大
主机
之间
代码
位置
过程
变化
一致
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
互联网科技巨头监管
科技股互联网
互联网巨头科技公司
互联网科技ppt模板
易通互联网络科技有限公司
菲比寻常互联网科技
深圳艾佳互联网科技
互联网科技美容
镁科技互联网资讯平台
海南科技产业互联网平台
互联网科技公司招聘
中国航天科技大学国际工业互联网
互联网与医疗科技
畅思互联网科技
南通创西澳互联网科技有限公司
上海互联网科技公司ppt
吉林省码上互联网科技电话
科技信息时代互联网发展
科技互联网专业工作会议发言稿
互联网科技自媒体灵感
科技金融是不是互联网金融
互联网科技金融公司
苏州互联网科技贷款公司
融贸通互联网科技
互联网科技网站
科技大学互联网专业好不好
互联网科技如何创业
山东星卡互联网科技有限公司官网
广州千川互联网科技有限公司
科技互联网公司两年变化