Prevent mtcClient from sending to uninitialized socket in AIO SX

The mtcClient will perform a socket reinit if it detects a socket
failure. The mtcClient also avoids setting up its controller-1
cluster network socket for the AIO SX system type ; because there
is no controller-1 provisioned.

Most AIO SX systems have the management/cluster networks set to
the 'loopback' interface. However, when an AIO SX system is setup
with its management and cluster networks on physical interfaces,
with or without vlan, the mtcAlive send message utility will try
to send to the uninitialized controller-1 cluster socket. This
leads to a socket error that triggers a socket reinitialization
loop which causes log flooding.

This update adds a check to the mtcAlive send utility to avoid
sending mtcAlive to controller-1 for AIO SX system type where
there is no controller-1 provisioned; no send,no error,no flood.

Since this update needed to add a system type check, this update
also implemented a system type definition rename from CPE to AIO.
Other related definitions and comments were also changed to make
the code base more understandable and maintainable

Test Plan:

PASS: Verify AIO SX with mgmnt/clstr on physical (failure mode)
PASS: Verify AIO SX Install with mgmnt/clstr on 'lo'
PASS: Verify AIO SX Lock msg and ack over mgmnt and clstr
PASS: Verify AIO SX locked-disabled-online state
PASS: Verify mtcClient clstr socket error detect/auto-recovery (fit)
PASS: Verify mtcClient mgmnt socket error detect/auto-recovery (fit)

Regression:

PASS: Verify AIO SX Lock and Unlock (lazy reboot)
PASS: Verify AIO DX and DC install with pv regression and sanity
PASS: Verify Standard system install with pv regression and sanity

Change-Id: I658d33a677febda6c0e3fcb1d7c18e5b76cb3762
Closes-Bug: 1897334
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
This commit is contained in:
Eric MacDonald 2021-04-21 10:12:30 -04:00
parent 412ff83f25
commit 7539d36c3f
16 changed files with 96 additions and 81 deletions

View File

@ -185,7 +185,7 @@ typedef enum
#define DEFAULT_MTCALIVE_TIMEOUT (1200)
#define DEFAULT_GOENABLE_TIMEOUT (300)
#define DEFAULT_DOR_MODE_TIMEOUT (20)
#define DEFAULT_DOR_MODE_CPE_TIMEOUT (600)
#define DEFAULT_DOR_MODE_AIO_TIMEOUT (600)
/** TODO: Convert names to omit JSON part */
#define MTC_JSON_INV_LABEL "ihosts"
@ -311,7 +311,7 @@ typedef enum
#define MTC_TASK_POWERCYCLE_FAIL "Critical Event Power-Cycle %d; failed"
#define MTC_TASK_POWERCYCLE_DOWN "Critical Event Power-Down ; due to persistent critical sensor"
#define MTC_TASK_RESETTING_HOST "Resetting Host, critical sensor"
#define MTC_TASK_CPE_SX_UNLOCK_MSG "Unlocking, please stand-by while the system gracefully reboots"
#define MTC_TASK_AIO_SX_UNLOCK_MSG "Unlocking, please stand-by while the system gracefully reboots"
#define MTC_TASK_SELF_UNLOCK_MSG "Unlocking active controller, please stand-by while it reboots"
#define MTC_TASK_FAILED_SWACT_REQ "Critical failure.Requesting SWACT to enabled standby controller"
#define MTC_TASK_FAILED_NO_BACKUP "Critical failure.Please provision/enable standby controller"
@ -383,8 +383,8 @@ typedef enum
/* 5 milliseconds */
#define MTCAGENT_SELECT_TIMEOUT (5000)
/* dedicate more idle time in CPE ; there is less maintenance to do */
#define MTCAGENT_CPE_SELECT_TIMEOUT (10000)
/* dedicate more idle time in AIO ; there is less maintenance to do */
#define MTCAGENT_AIO_SELECT_TIMEOUT (10000)
/** Number of retries maintenance will do when it experiences
* a REST API call failure ; any failure */

View File

@ -38,15 +38,15 @@ using namespace std ;
/* List of different types */
typedef enum
{
SYSTEM_TYPE__NORMAL =0,
SYSTEM_TYPE__CPE_MODE__DUPLEX =1,
SYSTEM_TYPE__CPE_MODE__DUPLEX_DIRECT =2,
SYSTEM_TYPE__CPE_MODE__SIMPLEX =3,
SYSTEM_TYPE__NORMAL =0,
SYSTEM_TYPE__AIO__DUPLEX =1,
SYSTEM_TYPE__AIO__DUPLEX_DIRECT =2,
SYSTEM_TYPE__AIO__SIMPLEX =3,
} system_type_enum ;
/** Called by signal handler on daemon exit
* Performs cleanup by closing open files
* Performs cleanup by closing open files
* and freeing used memory */
void daemon_exit ( void );

View File

@ -347,7 +347,7 @@ string daemon_mgmnt_iface ( void )
system_type_enum daemon_system_type ( void )
{
char buffer [BUFFER];
system_type_enum system_type = SYSTEM_TYPE__CPE_MODE__SIMPLEX ;
system_type_enum system_type = SYSTEM_TYPE__AIO__SIMPLEX ;
FILE * cfg_file_stream = fopen ( PLATFORM_CONF_FILE, "r" );
if ( cfg_file_stream != NULL )
{
@ -401,11 +401,11 @@ system_type_enum daemon_system_type ( void )
if ( !mode.empty() )
{
if ( mode.compare("duplex") == 0 )
system_type = SYSTEM_TYPE__CPE_MODE__DUPLEX ;
system_type = SYSTEM_TYPE__AIO__DUPLEX ;
else if ( mode.compare("duplex-direct") == 0 )
system_type = SYSTEM_TYPE__CPE_MODE__DUPLEX_DIRECT ;
system_type = SYSTEM_TYPE__AIO__DUPLEX_DIRECT ;
else if ( mode.compare("simplex") == 0 )
system_type = SYSTEM_TYPE__CPE_MODE__SIMPLEX ;
system_type = SYSTEM_TYPE__AIO__SIMPLEX ;
else
{
elog ("%s All-In-One system type ; mode unknown\n", SYSTEM_TYPE_PREFIX );
@ -438,21 +438,21 @@ system_type_enum daemon_system_type ( void )
ilog("%s Standard System\n", SYSTEM_TYPE_PREFIX);
break ;
}
case SYSTEM_TYPE__CPE_MODE__DUPLEX_DIRECT:
case SYSTEM_TYPE__AIO__DUPLEX_DIRECT:
{
ilog ("%s All-in-one Duplex Direct Connect\n", SYSTEM_TYPE_PREFIX );
break ;
}
case SYSTEM_TYPE__CPE_MODE__DUPLEX:
case SYSTEM_TYPE__AIO__DUPLEX:
{
ilog ("%s All-in-one Duplex\n", SYSTEM_TYPE_PREFIX );
break ;
}
case SYSTEM_TYPE__CPE_MODE__SIMPLEX:
case SYSTEM_TYPE__AIO__SIMPLEX:
default:
{
ilog ("%s All-in-one Simplex \n", SYSTEM_TYPE_PREFIX );
system_type = SYSTEM_TYPE__CPE_MODE__SIMPLEX ;
system_type = SYSTEM_TYPE__AIO__SIMPLEX ;
break ;
}
}

View File

@ -2707,7 +2707,7 @@ int nodeLinkClass::add_host ( node_inv_type & inv )
node_ptr->operState = operState_str_to_enum (inv.oper.data ());
node_ptr->availStatus = availStatus_str_to_enum (inv.avail.data());
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
node_ptr->operState_subf = operState_str_to_enum (inv.oper_subf.data());
node_ptr->availStatus_subf = availStatus_str_to_enum (inv.avail_subf.data());
@ -2819,7 +2819,7 @@ int nodeLinkClass::add_host ( node_inv_type & inv )
node_ptr->operState = operState_str_to_enum (inv.oper.data ());
node_ptr->availStatus = availStatus_str_to_enum (inv.avail.data());
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
node_ptr->operState_subf = operState_str_to_enum (inv.oper_subf.data());
node_ptr->availStatus_subf = availStatus_str_to_enum (inv.avail_subf.data());
@ -2836,7 +2836,7 @@ int nodeLinkClass::add_host ( node_inv_type & inv )
node_ptr->operState = operState_str_to_enum (inv.oper.data ());
node_ptr->availStatus = availStatus_str_to_enum (inv.avail.data());
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
node_ptr->operState_subf = operState_str_to_enum (inv.oper_subf.data());
node_ptr->availStatus_subf = availStatus_str_to_enum (inv.avail_subf.data());
@ -2854,7 +2854,7 @@ int nodeLinkClass::add_host ( node_inv_type & inv )
node_ptr->operState = operState_str_to_enum (inv.oper.data ());
node_ptr->availStatus = availStatus_str_to_enum (inv.avail.data());
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
node_ptr->operState_subf = operState_str_to_enum (inv.oper_subf.data());
node_ptr->availStatus_subf = availStatus_str_to_enum (inv.avail_subf.data());
@ -2872,7 +2872,7 @@ int nodeLinkClass::add_host ( node_inv_type & inv )
node_ptr->operState = operState_str_to_enum (inv.oper.data ());
node_ptr->availStatus = availStatus_str_to_enum (inv.avail.data());
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
node_ptr->operState_subf = operState_str_to_enum (inv.oper_subf.data());
node_ptr->availStatus_subf = availStatus_str_to_enum (inv.avail_subf.data());
@ -2890,7 +2890,7 @@ int nodeLinkClass::add_host ( node_inv_type & inv )
node_ptr->operState = operState_str_to_enum (inv.oper.data ());
node_ptr->availStatus = availStatus_str_to_enum (inv.avail.data());
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
node_ptr->operState_subf = operState_str_to_enum (inv.oper_subf.data());
node_ptr->availStatus_subf = availStatus_str_to_enum (inv.avail_subf.data());
@ -2941,7 +2941,7 @@ int nodeLinkClass::add_host ( node_inv_type & inv )
node_ptr->operState = MTC_OPER_STATE__DISABLED ;
node_ptr->availStatus = MTC_AVAIL_STATUS__OFFLINE ;
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
node_ptr->operState_subf = MTC_OPER_STATE__DISABLED ;
node_ptr->availStatus_subf = MTC_AVAIL_STATUS__OFFLINE ;
@ -2959,7 +2959,7 @@ int nodeLinkClass::add_host ( node_inv_type & inv )
node_ptr->operState = operState_str_to_enum (inv.oper.data ());
node_ptr->availStatus = availStatus_str_to_enum (inv.avail.data());
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
node_ptr->operState_subf = operState_str_to_enum (inv.oper_subf.data());
node_ptr->availStatus_subf = availStatus_str_to_enum (inv.avail_subf.data());
@ -4211,7 +4211,7 @@ void nodeLinkClass::set_mtce_flags ( string hostname, int flags, int iface )
/* Deal with sub-function if AIO controller host */
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
if ( flags & MTC_FLAG__SUBF_GOENABLED )
{
@ -7637,7 +7637,7 @@ int nodeLinkClass::ar_manage ( struct nodeLinkClass::node * node_ptr,
mtcInvApi_update_states ( node_ptr, "unlocked", "disabled", "failed" );
if (( NOT_THIS_HOST ) &&
( this->system_type != SYSTEM_TYPE__CPE_MODE__SIMPLEX ))
( this->system_type != SYSTEM_TYPE__AIO__SIMPLEX ))
{
if ( ++node_ptr->ar_count[node_ptr->ar_cause] >=
this->ar_threshold [node_ptr->ar_cause] )
@ -9252,7 +9252,7 @@ void nodeLinkClass::mem_log_type_info ( struct nodeLinkClass::node * node_ptr )
node_ptr->function);
mem_log (str);
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
snprintf (&str[0], MAX_MEM_LOG_DATA, "%s\tSub-Function: %s (%u) (SubFunc Enabled:%c)\n",
node_ptr->hostname.c_str(),

View File

@ -76,11 +76,11 @@ using namespace std;
#define LARGE_SYSTEM \
( this->system_type == SYSTEM_TYPE__NORMAL )
#define CPE_SYSTEM \
#define AIO_SYSTEM \
( this->system_type != SYSTEM_TYPE__NORMAL )
#define SIMPLEX_CPE_SYSTEM \
( this->system_type == SYSTEM_TYPE__CPE_MODE__SIMPLEX )
#define SIMPLEX_AIO_SYSTEM \
( this->system_type == SYSTEM_TYPE__AIO__SIMPLEX )
/**
* @addtogroup nodeLinkClass

View File

@ -1848,7 +1848,7 @@ void daemon_service_run ( void )
clock_gettime (CLOCK_MONOTONIC, &sm_heartbeat_timestamp_last );
/* no need for the heartbeat audit in a simplex system */
if ( hbsInv.system_type != SYSTEM_TYPE__CPE_MODE__SIMPLEX )
if ( hbsInv.system_type != SYSTEM_TYPE__AIO__SIMPLEX )
{
/* start the state audit */
/* run the first audit in 30 seconds */
@ -2063,7 +2063,7 @@ void daemon_service_run ( void )
hbsInv.active_controller ? "" : "in" );
/* no need for the heartbeat audit in a simplex system */
if ( hbsInv.system_type != SYSTEM_TYPE__CPE_MODE__SIMPLEX )
if ( hbsInv.system_type != SYSTEM_TYPE__AIO__SIMPLEX )
{
/* Due to activity state change we will dump
* the heartbeat cluster state at now time

View File

@ -254,7 +254,7 @@ void hwmonGroup_init ( string & hostname , struct sensor_group_type * group_ptr
group_ptr->actions_critical_choices.append(HWMON_ACTION_ALARM);
/* Don't support reset and power cycle in AIO simplex mode */
if ( obj_ptr->system_type != SYSTEM_TYPE__CPE_MODE__SIMPLEX )
if ( obj_ptr->system_type != SYSTEM_TYPE__AIO__SIMPLEX )
{
group_ptr->actions_critical_choices.append(",");
group_ptr->actions_critical_choices.append(HWMON_ACTION_RESET);

View File

@ -952,15 +952,18 @@ int send_mtcAlive_msg ( mtc_socket_type * sock_ptr, string identity, int interfa
}
/* Send to controller-1 cluster address */
if (( sock_ptr->mtc_client_tx_socket_c1_clstr ) &&
( sock_ptr->mtc_client_tx_socket_c1_clstr->sock_ok() == true ))
if ( get_ctrl_ptr()->system_type != SYSTEM_TYPE__AIO__SIMPLEX )
{
print_mtc_message ( CONTROLLER_1, MTC_CMD_TX, msg, get_iface_name_str(CLSTR_INTERFACE), false );
sock_ptr->mtc_client_tx_socket_c1_clstr->write((char*)&msg.hdr[0], bytes ) ;
}
else
{
elog("mtc_client_tx_socket_c1_clstr not ok");
if (( sock_ptr->mtc_client_tx_socket_c1_clstr ) &&
( sock_ptr->mtc_client_tx_socket_c1_clstr->sock_ok() == true ))
{
print_mtc_message ( CONTROLLER_1, MTC_CMD_TX, msg, get_iface_name_str(CLSTR_INTERFACE), false );
sock_ptr->mtc_client_tx_socket_c1_clstr->write((char*)&msg.hdr[0], bytes ) ;
}
else
{
elog("mtc_client_tx_socket_c1_clstr not ok");
}
}
}
else

View File

@ -1224,7 +1224,7 @@ int service_events ( nodeLinkClass * obj_ptr, mtc_socket_type * sock_ptr )
else if ( msg.cmd == MTC_EVENT_HEARTBEAT_READY )
{
/* no heartbeating in simplex mode */
if ( obj_ptr->system_type == SYSTEM_TYPE__CPE_MODE__SIMPLEX )
if ( obj_ptr->system_type == SYSTEM_TYPE__AIO__SIMPLEX )
{
return (PASS);
}

View File

@ -974,7 +974,7 @@ int nodeLinkClass::mtcInvApi_update_states_now ( struct nodeLinkClass::node * no
else
avail = " " ;
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
if ( ! oper_subf.empty() )
{
@ -1016,7 +1016,7 @@ int nodeLinkClass::mtcInvApi_update_states_now ( struct nodeLinkClass::node * no
this->sysinvEvent.payload.erase(len-1,1);
this->sysinvEvent.payload.append ( "]");
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
ilog ("%s %s-%s-%s %s-%s\n",
node_ptr->hostname.c_str(),

View File

@ -449,7 +449,7 @@ void setup_clstr_tx_sockets ( void )
mtc_sock.mtc_client_tx_socket_c0_clstr->sock_ok(false);
}
}
if ( ctrl.system_type != SYSTEM_TYPE__CPE_MODE__SIMPLEX )
if ( ctrl.system_type != SYSTEM_TYPE__AIO__SIMPLEX )
{
dlog ("setup of %s TX\n", CONTROLLER_1_CLUSTER_HOST);
@ -1401,8 +1401,20 @@ void daemon_service_run ( void )
socket_reinit = true ;
}
/* Clstr Tx */
else if (( ctrl.clstr_iface_provisioned == true ) &&
/* Clstr Tx ; AIO SX */
else if ((ctrl.system_type == SYSTEM_TYPE__AIO__SIMPLEX) &&
( ctrl.clstr_iface_provisioned == true ) &&
(( mtc_sock.mtc_client_tx_socket_c0_clstr == NULL ) ||
( mtc_sock.mtc_client_tx_socket_c0_clstr->sock_ok() == false )))
{
wlog ("calling setup_clstr_tx_sockets (auto-recovery)\n");
setup_clstr_tx_sockets();
socket_reinit = true ;
}
/* Clstr Tx ; not AIO SX */
else if ((ctrl.system_type != SYSTEM_TYPE__AIO__SIMPLEX) &&
( ctrl.clstr_iface_provisioned == true ) &&
(( mtc_sock.mtc_client_tx_socket_c0_clstr == NULL ) ||
( mtc_sock.mtc_client_tx_socket_c1_clstr == NULL ) ||
( mtc_sock.mtc_client_tx_socket_c0_clstr->sock_ok() == false ) ||
@ -1713,7 +1725,7 @@ int run_hostservices_scripts ( unsigned int cmd )
/* For the stop command we need the mtcClient to run both controller and
* worker stop services if we are on a CPE system.
* worker stop services if we are on a AIO system.
* This saves the mtcAgent from having to issue and manage 2 commands,
* one for controller and 1 for worker */
if ( ctrl.system_type != SYSTEM_TYPE__NORMAL )

View File

@ -1507,9 +1507,9 @@ void daemon_service_run ( void )
if ( ts.tv_sec < MTC_MINS_15 )
{
/* CPE DOR window is much greater in CPE since heartbeat
* cannot start until the inactive CPE has run both manifests */
int timeout = DEFAULT_DOR_MODE_CPE_TIMEOUT ;
/* AIO DOR window is much greater in AIO since heartbeat
* cannot start until the inactive AIO has run both manifests */
int timeout = DEFAULT_DOR_MODE_AIO_TIMEOUT ;
/* override the timeout to a smaller value for normal system */
if ( mtcInv.system_type == SYSTEM_TYPE__NORMAL )
@ -1593,7 +1593,7 @@ void daemon_service_run ( void )
if ( mtcInv.system_type == SYSTEM_TYPE__NORMAL )
mtc_sock.waitd.tv_usec = MTCAGENT_SELECT_TIMEOUT ;
else
mtc_sock.waitd.tv_usec = MTCAGENT_CPE_SELECT_TIMEOUT ;
mtc_sock.waitd.tv_usec = MTCAGENT_AIO_SELECT_TIMEOUT ;
/* This is used as a delay up to select_timeout */
rc = select( socks.back()+1, &mtc_sock.readfds, NULL, NULL, &mtc_sock.waitd);

View File

@ -315,10 +315,10 @@ int nodeLinkClass::fsm ( struct nodeLinkClass::node * node_ptr )
}
/****************************************************************************
* No Op: Do nothing for this Healthy Enabled Locked CPE Simplex Host
* No Op: Do nothing for this Healthy Enabled Locked AIO Simplex Host
****************************************************************************
*/
else if (( this->system_type == SYSTEM_TYPE__CPE_MODE__SIMPLEX ) &&
else if (( this->system_type == SYSTEM_TYPE__AIO__SIMPLEX ) &&
( node_ptr->adminAction == MTC_ADMIN_ACTION__NONE ) &&
( node_ptr->adminState == MTC_ADMIN_STATE__LOCKED ))
{

View File

@ -481,7 +481,7 @@ int nodeLinkClass::enable_handler ( struct nodeLinkClass::node * node_ptr )
if ( node_ptr->adminAction == MTC_ADMIN_ACTION__UNLOCK )
{
bool aio = false ;
if ( SIMPLEX_CPE_SYSTEM )
if ( SIMPLEX_AIO_SYSTEM )
aio = true ;
else
aio = false ;
@ -525,7 +525,7 @@ int nodeLinkClass::enable_handler ( struct nodeLinkClass::node * node_ptr )
}
}
mtcInvApi_update_states_now ( node_ptr, "unlocked", "disabled" , "offline", "disabled", "offline" );
mtcInvApi_update_task_now ( node_ptr, aio ? MTC_TASK_CPE_SX_UNLOCK_MSG : MTC_TASK_SELF_UNLOCK_MSG );
mtcInvApi_update_task_now ( node_ptr, aio ? MTC_TASK_AIO_SX_UNLOCK_MSG : MTC_TASK_SELF_UNLOCK_MSG );
wlog ("%s unlocking %s with reboot\n",
my_hostname.c_str(),
@ -546,7 +546,7 @@ int nodeLinkClass::enable_handler ( struct nodeLinkClass::node * node_ptr )
* Condition 1: While there is no in-service backup controller
* to swact to. In this case the ctive controller
* - is only degraded to avoid a system outage.
* - the CPE subfunction is failed
* - the AIO subfunction is failed
* - worker SubFunction Alarm is raised
* - Enable alarm is raised
* - A process monitor alarm may also be raised if
@ -648,7 +648,7 @@ int nodeLinkClass::enable_handler ( struct nodeLinkClass::node * node_ptr )
}
else
{
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
/* Raise Critical Compute Function Alarm */
alarm_compute_failure ( node_ptr , FM_ALARM_SEVERITY_CRITICAL );
@ -661,7 +661,7 @@ int nodeLinkClass::enable_handler ( struct nodeLinkClass::node * node_ptr )
node_ptr->graceful_recovery_counter = 0 ;
node_ptr->health_threshold_counter = 0 ;
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
node_ptr->inservice_failed_subf = true ;
subfStateChange ( node_ptr, MTC_OPER_STATE__DISABLED,
@ -1358,7 +1358,7 @@ int nodeLinkClass::enable_handler ( struct nodeLinkClass::node * node_ptr )
* have a worker function and the heartbeat for those hosts
* are started at the end of the subfunction handler. */
if (( THIS_HOST ) ||
(( CPE_SYSTEM ) && ( is_controller(node_ptr)) ))
(( AIO_SYSTEM ) && ( is_controller(node_ptr)) ))
{
enableStageChange ( node_ptr, MTC_ENABLE__STATE_CHANGE );
}
@ -1523,8 +1523,8 @@ int nodeLinkClass::enable_handler ( struct nodeLinkClass::node * node_ptr )
if ( is_controller(node_ptr) )
{
/* Defer telling SM the controller state if
* this is a CPE and this is the only controller */
if ( CPE_SYSTEM && ( num_controllers_enabled() > 0 ))
* this is a AIO and this is the only controller */
if ( AIO_SYSTEM && ( num_controllers_enabled() > 0 ))
{
wlog ("%s deferring SM enable notification till subfunction-enable complete\n",
node_ptr->hostname.c_str());
@ -1555,7 +1555,7 @@ int nodeLinkClass::enable_handler ( struct nodeLinkClass::node * node_ptr )
enableStageChange ( node_ptr, MTC_ENABLE__START );
if (( CPE_SYSTEM ) && ( is_controller(node_ptr)))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr)))
{
ilog ("%s running worker sub-function enable handler\n", node_ptr->hostname.c_str());
mtcInvApi_update_task ( node_ptr, MTC_TASK_ENABLING_SUBF );
@ -1876,7 +1876,7 @@ int nodeLinkClass::recovery_handler ( struct nodeLinkClass::node * node_ptr )
MTC_OPER_STATE__DISABLED,
MTC_AVAIL_STATUS__FAILED );
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
subfStateChange ( node_ptr, MTC_OPER_STATE__DISABLED,
MTC_AVAIL_STATUS__FAILED );
@ -2267,7 +2267,7 @@ int nodeLinkClass::recovery_handler ( struct nodeLinkClass::node * node_ptr )
{
/* The active controller would never get/be here but
* if it did then just fall through to change state. */
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
/* Here we need to run the sub-fnction goenable and start
* host services if this is the other controller in a AIO
@ -2511,7 +2511,7 @@ int nodeLinkClass::recovery_handler ( struct nodeLinkClass::node * node_ptr )
}
case MTC_RECOVERY__STATE_CHANGE:
{
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
/* Set node as unlocked-enabled */
subfStateChange ( node_ptr, MTC_OPER_STATE__ENABLED,
@ -2770,7 +2770,7 @@ int nodeLinkClass::disable_handler ( struct nodeLinkClass::node * node_ptr )
MTC_OPER_STATE__DISABLED,
locked_status );
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
subfStateChange ( node_ptr, MTC_OPER_STATE__DISABLED,
locked_status );
@ -3419,7 +3419,7 @@ int nodeLinkClass::online_handler ( struct nodeLinkClass::node * node_ptr )
/* otherwise change state */
mtcInvApi_update_state(node_ptr, MTC_JSON_INV_AVAIL,"offline" );
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
mtcInvApi_update_state(node_ptr, MTC_JSON_INV_AVAIL_SUBF,"offline" );
}
@ -3460,7 +3460,7 @@ int nodeLinkClass::online_handler ( struct nodeLinkClass::node * node_ptr )
node_ptr->hostname.c_str());
mtcInvApi_update_state ( node_ptr, MTC_JSON_INV_AVAIL, "online" );
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
mtcInvApi_update_state ( node_ptr, MTC_JSON_INV_AVAIL_SUBF, "online" );
}
@ -6080,7 +6080,7 @@ int nodeLinkClass::add_handler ( struct nodeLinkClass::node * node_ptr )
mtcInfo_log(node_ptr);
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
if ( daemon_is_file_present ( CONFIG_COMPLETE_WORKER ) == false )
{
@ -6325,7 +6325,7 @@ int nodeLinkClass::add_handler ( struct nodeLinkClass::node * node_ptr )
send_hbs_command ( node_ptr->hostname, MTC_CMD_ADD_HOST );
if ( ( CPE_SYSTEM ) || ( is_worker (node_ptr) == true ))
if ( ( AIO_SYSTEM ) || ( is_worker (node_ptr) == true ))
{
send_guest_command ( node_ptr->hostname, MTC_CMD_ADD_HOST );
}
@ -6365,11 +6365,11 @@ int nodeLinkClass::add_handler ( struct nodeLinkClass::node * node_ptr )
( node_ptr->operState == MTC_OPER_STATE__ENABLED ))
{
/* start the heartbeat service in all cases except for
* THIS host and CPE controller hosts */
* THIS host and AIO controller hosts */
if ( NOT_THIS_HOST )
{
if (( LARGE_SYSTEM ) ||
(( CPE_SYSTEM ) && ( this->dor_mode_active == false )))
(( AIO_SYSTEM ) && ( this->dor_mode_active == false )))
{
send_hbs_command ( node_ptr->hostname, MTC_CMD_START_HOST );
}
@ -6402,7 +6402,7 @@ int nodeLinkClass::add_handler ( struct nodeLinkClass::node * node_ptr )
node_ptr->configAction = MTC_CONFIG_ACTION__INSTALL_PASSWD ;
}
if (( ! SIMPLEX_CPE_SYSTEM ) &&
if (( ! SIMPLEX_AIO_SYSTEM ) &&
( node_ptr->bmc_provisioned == true ))
{
mtcAlarm_clear ( node_ptr->hostname, MTC_ALARM_ID__BM );
@ -6410,7 +6410,7 @@ int nodeLinkClass::add_handler ( struct nodeLinkClass::node * node_ptr )
}
/* Special Add handling for the AIO system */
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
if (( node_ptr->adminState == MTC_ADMIN_STATE__UNLOCKED ) &&
( node_ptr->operState == MTC_OPER_STATE__ENABLED ))
@ -7484,7 +7484,7 @@ int nodeLinkClass::insv_test_handler ( struct nodeLinkClass::node * node_ptr )
* In the restart case the subfunction fsm enable handler is not run so
* we try to detect the missing goenabled_subf flag as an inservice test.
*
* Only in CPE type
* Only in AIO type
* - clear the alarm if the issue goes away -
* i.e. the goenabled tests eventually pass. Today
* hey are not re-run in the background but someday they may be
@ -7492,7 +7492,7 @@ int nodeLinkClass::insv_test_handler ( struct nodeLinkClass::node * node_ptr )
* and we have only a single enabled controller (which must be this one)
* and the alarm is not already raised.
**/
if (( CPE_SYSTEM ) && ( is_controller(node_ptr) == true ))
if (( AIO_SYSTEM ) && ( is_controller(node_ptr) == true ))
{
if (( node_ptr->adminState == MTC_ADMIN_STATE__UNLOCKED ) &&
( node_ptr->operState == MTC_OPER_STATE__ENABLED ) &&

View File

@ -96,7 +96,7 @@ int nodeLinkClass::mtcSmgrApi_request ( struct nodeLinkClass::node * node_ptr, m
int rc = PASS ;
string operation_string = "unknown" ;
if ( system_type == SYSTEM_TYPE__CPE_MODE__SIMPLEX )
if ( system_type == SYSTEM_TYPE__AIO__SIMPLEX )
{
dlog ("%s simpex mode ; SM '%d' request not sent\n", node_ptr->hostname.c_str(), operation );
return ( PASS );

View File

@ -169,7 +169,7 @@ int nodeLinkClass::enable_subf_handler ( struct nodeLinkClass::node * node_ptr )
*
* issue: subfunction go-enable patching script fails and
* maintenance reboots the active controller when no-reboot
* patching maintenance in CPE.
* patching maintenance in AIO.
*
* The fix is to avoid running the subfunction go-enabled tests
* on self while patching.
@ -490,7 +490,7 @@ int nodeLinkClass::enable_subf_handler ( struct nodeLinkClass::node * node_ptr )
fail = true ;
}
else if ( this->system_type != SYSTEM_TYPE__CPE_MODE__SIMPLEX )
else if ( this->system_type != SYSTEM_TYPE__AIO__SIMPLEX )
{
/* Loop over the heartbeat interfaces and fail the Enable if any of them are failing */
for ( int i = 0 ; i < MAX_IFACES ; i++ )