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

Kernel_IAdminHotStandby::RestartStandbyResult Kernel_Administration::RestartStandby ( tsp00_TaskId  taskid,
tgg00_TransContext &  serverStartContext,
SAPDBErr_MessageList errlist 
) [private, virtual]

This initiates the standby role (permanent restart until TakeOver).

A server task is started which is doing the restart for this standby.

Parameters:
taskid is used for synchronization.
serverStartContext this is only used to start the restart server task.
errlist may be filled with any additional error message.
Returns:
RestartStandbyResult
Precondition:
  • The parameters must be set up for a standby configuration.
  • The role must be standby.
  • The admin state must not be online or redo.

Implements Kernel_IAdminHotStandby.

Definition at line 2799 of file Kernel_Administration.cpp.

References Kernel_State::EnterCriticalState(), RTEHSS_KernelInterface::GotRestartStandby(), RTEHSS_KernelInterface::Instance(), Kernel_State::IsOnline(), Kernel_State::IsRedo(), Kernel_State::IsStandby(), Kernel_State::LeaveCriticalState(), m_State, and RestartPrepare().

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

    RTEHSS_KernelInterface &hss                = RTEHSS_KernelInterface::Instance();
    tgg00_BasisError       &trError            = serverStartContext.trError_gg00;
    
    if ( ! m_State.IsStandby() )
    {
        errlist = Admin_Exception(__CONTEXT__,KERNEL_COMMAND_NOT_ALLOWED,"Restart Standby","role is not standby");
        return RestartStandbyWrongRole;
    }

    if ( m_State.IsOnline() )
    {
        errlist = Admin_Exception(__CONTEXT__,KERNEL_COMMAND_NOT_ALLOWED,"Restart Standby","state is online");
        return RestartStandbyNotAllowed;
    }

    if ( m_State.IsRedo() )
    {
        errlist = Admin_Exception(__CONTEXT__,KERNEL_COMMAND_NOT_ALLOWED,"Restart Standby","state is redo");
        return RestartStandbyNotAllowed;
    }

    if ( ! m_State.EnterCriticalState(Kernel_State::criticalStateRedo) )
    {
        errlist = Admin_Exception(__CONTEXT__, KERNEL_ENTER_CRITICAL_STATE_FAILED, "Redo");
        return RestartStandbyNotAllowed;
    }

    // Notify RESTART STANDBY was accepted
    hss.GotRestartStandby();
    
    if ( ! RestartPrepare (serverStartContext, restartKindStandby, errlist) )
    {
        m_State.LeaveCriticalState(Kernel_State::criticalStateRedo);
        return RestartStandbyRestartPrepareFailed;
    }
    
    // START THE (REDO LOG) STANDBY SERVER
    
    tgg00_TransChild childtrans;
    tgg00_MessBlock  sendmblock;

    g01mblock_init (serverStartContext, m_restart, mm_standby, sendmblock);
    k53child_trans_build (m_restart, 0, childtrans);
    sendmblock.mb_reply() = false;
    
    k90send (sendmblock, childtrans);
    
    if ( sendmblock.mb_trns()->trError_gg00 != e_ok )
    {
        m_State.LeaveCriticalState(Kernel_State::criticalStateRedo);
        return RestartStandbyTriggerServerFailed;
    }

    return RestartStandbyOk;
}


Generated by  Doxygen 1.6.0   Back to index