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();                            
            …                            
        }                                
                                        
        …                                
    }                                    
  • 相关阅读:
    BZOJ1066: [SCOI2007]蜥蜴
    BZOJ1934: [Shoi2007]Vote 善意的投票
    BZOJ2321: [BeiJing2011集训]星器
    BZOJ1076: [SCOI2008]奖励关
    BZOJ1821: [JSOI2010]Group 部落划分 Group
    BZOJ3038: 上帝造题的七分钟2
    NOIP2017滚粗记
    BZOJ1087: [SCOI2005]互不侵犯King
    BZOJ1085: [SCOI2005]骑士精神
    BZOJ1295: [SCOI2009]最长距离
  • 原文地址:https://www.cnblogs.com/gaojian/p/3231932.html
Copyright © 2011-2022 走看看