Logo Search packages:      
Sourcecode: maxdb-7.5.00 version File versions

void Kernel_Administration::RestoreLog ( tgg00_TransContext &  trans,
tgg00_MessBlock &  restoreDescription 
) [private, virtual]

After log was restored the kernel is restarted to online mode. This is a restart with log entries from backup.

Implements Kernel_IAdminBackupRecovery.

Definition at line 747 of file Kernel_Administration.cpp.

References Kernel_State::EnterCriticalState(), IsCheckBackupConfigured(), Kernel_State::IsStandby(), Kernel_State::LeaveCriticalState(), m_State, Offline(), and RestartIntern().

{
    SAPDBTRACE_METHOD_DEBUG ("Kernel_Administration::RestoreLog", Common_Trace, 5);

    if ( m_State.IsStandby() )
    {
        RTE_Message (Admin_Exception(__CONTEXT__,KERNEL_COMMAND_NOT_ALLOWED,"Log recovery","StandByRole"));
        trans.trError_gg00 = e_hotstandby_wrong_role;
        return;
    }
    if ( ! m_State.EnterCriticalState(Kernel_State::criticalStateBackup) )
    {
        RTE_Message (Admin_Exception(__CONTEXT__,KERNEL_CRITICAL_STATE_NOT_ENTERED,"Backup"));
        trans.trError_gg00 = e_dbm_command_not_possible;
        return;
    }
    if ( ! m_State.EnterCriticalState(Kernel_State::criticalStateRedo) )
    {
        RTE_Message (Admin_Exception(__CONTEXT__,KERNEL_CRITICAL_STATE_NOT_ENTERED,"Redo"));
        m_State.LeaveCriticalState(Kernel_State::criticalStateBackup);
        trans.trError_gg00 = e_dbm_command_not_possible;
        return;
    }

    trans.trError_gg00 = e_ok;

    const bool onlyCheck = IsCheckBackupConfigured();
    
    if ( ! onlyCheck )
    {
        // Until dat and time is given to the backup/restore component
        // which calls RedoLog later.
        RestartIntern (trans, restartKindRestoreLog, Kernel_Date(), Kernel_Time(), Log_IOSequenceNo());
        if ( trans.trError_gg00 != e_ok )
            Offline (trans.trError_gg00);
    }

    k38init_restore (restoreDescription, onlyCheck);
    if ( trans.trError_gg00 != e_ok )
        Offline (trans.trError_gg00);

    k38headmaster (restoreDescription);
    if (    trans.trError_gg00 != e_ok
         && trans.trError_gg00 != e_new_hostfile_required 
         && trans.trError_gg00 != e_wrong_hostfile
         && trans.trError_gg00 != e_hostfile_error // PTS 1124787 mb 2003-10-23
         && trans.trError_gg00 != e_incompatible_log 
         && trans.trError_gg00 != e_invalid_label 
         && trans.trError_gg00 != e_save_skipped )
    {
        // S H U T   D O W N   T H E   K E R N E L   F O R   S E V E R E   E R R O R S
        Offline (trans.trError_gg00);
    }

    if ( e_new_hostfile_required == trans.trError_gg00 )
        return;
        
    if ( trans.trError_gg00 != e_ok )
    {
        tgg00_BasisError       logError = trans.trError_gg00;
        b01shutdown_filesystem(trans);
        trans.trError_gg00 = logError;
    }
    m_State.LeaveCriticalState(Kernel_State::criticalStateBackup);
    m_State.LeaveCriticalState(Kernel_State::criticalStateRedo);
}


Generated by  Doxygen 1.6.0   Back to index