zoukankan      html  css  js  c++  java
  • 初步学习pg_control文件之十三

    接前文,初步学习pg_control文件之十二

    看这个:

        * backupStartPoint is the redo pointer of the backup start checkpoint, if
         * we are recovering from an online backup and haven't reached the end of
         * backup yet. It is reset to zero when the end of backup is reached, and
         * we mustn't start up before that. A boolean would suffice otherwise, but
         * we use the redo pointer as a cross-check when we see an end-of-backup
         * record, to make sure the end-of-backup record corresponds the base
         * backup we're recovering from.
         */
        ...
        XLogRecPtr    backupStartPoint;

    是说如果处在online backup中时会使用它。只有下面一个地方进行了赋值:

    /*                                    
     * This must be called ONCE during postmaster or standalone-backend startup                                    
     */                                    
    void                                    
    StartupXLOG(void)                                    
    {                                    
        …                                
                                        
        /* REDO */                                
        if (InRecovery)                                
        {                                
            …                            
            /*                            
             * Set backupStartPoint if we're starting recovery from a base backup.                            
             * However, if there was no recovery.conf, and the backup was taken                            
             * with pg_start_backup(), we don't know if the server crashed before                            
             * the backup was finished and we're doing crash recovery on the                            
             * original server, or if we're restoring from the base backup. We                            
             * have to assume we're doing crash recovery in that case, or the                            
             * database would refuse to start up after a crash.                            
             */                            
            if ((InArchiveRecovery && haveBackupLabel) || backupEndRequired)                            
                ControlFile->backupStartPoint = checkPoint.redo;                        
                                        
            ControlFile->time = (pg_time_t) time(NULL);                            
            /* No need to hold ControlFileLock yet, we aren't up far enough */                            
            UpdateControlFile();                            
            …                            
        }                                
                                        
        …                                
    }                                    
  • 相关阅读:
    CentOS-7 虚拟机意外断电后的数据恢复
    CentOS7 搭建VNC 服务
    CentOS7-ulimit
    CentOS-7 初始化配置
    Centos Bond设置实例
    服务检测脚本
    sshd服务
    input常用属性
    前端工具-Sublime、WebStorm-快捷方式使用
    随机抽选效果、随机抽选红色球
  • 原文地址:https://www.cnblogs.com/gaojian/p/3231932.html
Copyright © 2011-2022 走看看