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

Kernel_IAdminHotStandby::InsertStandbyResult Kernel_Administration::InsertStandby ( tsp00_TaskId  taskid,
const SAPDB_Char *  standbyNodeId,
SAPDBErr_MessageList errlist 
) [private, virtual]

A new standby has registered to the master and this is called at every standby.

  • This is called by the master to propagate a new standby node.
  • The new node is added to the internal node list.
    Parameters:
    taskid is used for synchronization.
    standbyNodeId is the name of the new standby node
    errlist may be filled with any additional error message.
    Returns:
    InsertStandbyResult
    Precondition:
    The parameters must be set up for a standby configuration otherwise InsertStandbyWrongRole is returned

Implements Kernel_IAdminHotStandby.

Definition at line 3051 of file Kernel_Administration.cpp.

References Kernel_StateScope::EnterCriticalState(), RTEHSS_StandbyNodeList::Instance(), Kernel_State::IsMaster(), Kernel_State::IsStandby(), m_State, and RTEHSS_StandbyNodeList::SetWaitForSynchronize().

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

    if ( ! m_State.IsStandby() && ! m_State.IsMaster() )
    {
        errlist = Admin_Exception(__CONTEXT__,KERNEL_COMMAND_NOT_ALLOWED,"InsertStandby","role is neither master nor standby");
        return InsertStandbyWrongRole;
    }

    // PTS 1125942 mb 2004-02-13 synchronize insert/remove-standby by using state-information
    Kernel_StateScope state (Kernel_State::criticalStateConfiguration, m_State);
    if ( ! state.EnterCriticalState() )
    {
        errlist = Admin_Exception(__CONTEXT__,KERNEL_CRITICAL_STATE_NOT_ENTERED,"Configuration");
        return InsertStandbyNotAllowed;
    }

    RTE_Nodename newStandbyNode;
    
    strcpy ( newStandbyNode, standbyNodeId );

    SAPDB_Int4 nodeIndex;
    
    if ( ! RTEHSS_StandbyNodeList::Instance().AddNode(newStandbyNode, nodeIndex) )
    {
        errlist = Admin_Exception(__CONTEXT__, KERNEL_STANDBY_NODELIST_OP_FAILED,
                                  "INSERT STANDBY", newStandbyNode);
        return InsertStandbyAddNodeFailed;
    }
        
    RTEHSS_StandbyNodeList::Instance().SetWaitForSynchronize(nodeIndex);
    
    return InsertStandbyOk;
}


Generated by  Doxygen 1.6.0   Back to index