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

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

A standby was removed by the master and this is called at every standby.

  • This is called by the master to propagate the a standby node no longer is enabled.
  • The node name is removed from 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:
    RemoveStandbyResult
    Precondition:
    The parameters must be set up for a standby configuration otherwise RemoveStandbyWrongRole is returned

Implements Kernel_IAdminHotStandby.

Definition at line 3090 of file Kernel_Administration.cpp.

References Kernel_StateScope::EnterCriticalState(), RTEHSS_StandbyNodeList::Instance(), Kernel_DateTime::Invalidate(), SAPDB_Invalidatable< T, InvalidValue >::Invalidate(), Kernel_State::IsMaster(), Kernel_State::IsStandby(), m_Allocator, m_LastSyncOffset, m_LastSyncTime, m_State, m_SynchronizationIsNeeded, PropagateInfoAboutStandby(), and RTEHSS_StandbyNodeList::RemoveNode().

Referenced by BroadcastLineToStandbys(), and SynchronizeServer().

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

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

    // 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 RemoveStandbyNotAllowed;
    }
    

    RTE_Nodename remStandbyNode;
    
    strcpy ( remStandbyNode, standbyNodeId );

    SAPDB_Int4 nodeIndex;

    if ( ! RTEHSS_StandbyNodeList::Instance().FindNode(remStandbyNode, nodeIndex) )
    {
        errlist = Admin_Exception(__CONTEXT__, KERNEL_STANDBY_NODELIST_OP_FAILED,
                                  "REMOVE STANDBY", remStandbyNode);
        return RemoveStandbyNodeNotFound;
    }
      
    RTEHSS_StandbyNodeList::Instance().RemoveNode(nodeIndex);

    // tell all the other standby nodes that current standby node is not available
    SAPDB_UInt propagateErrors = PropagateInfoAboutStandby(m_Allocator, remStandbyNode, false, errlist);

    // if neccessary switch off synchronization
    if (RTEHSS_StandbyNodeList::Instance().IsEmpty())
    {
        m_SynchronizationIsNeeded  = false;
        m_LastSyncOffset.Invalidate();
        m_LastSyncTime.Invalidate();
        RTE_Message(Admin_Exception(__CONTEXT__, KERNEL_LAST_STANDBY_REMOVED,standbyNodeId));
    }
    else
    {
        RTE_Message(Admin_Exception(__CONTEXT__, KERNEL_STANDBY_REMOVED,standbyNodeId));
    }

    return RemoveStandbyOk;
}


Generated by  Doxygen 1.6.0   Back to index