From 6c93e742305a0200c42f4c2ca888f9856c09c4ad Mon Sep 17 00:00:00 2001 From: Bin Qian Date: Mon, 7 Jan 2019 10:50:10 -0500 Subject: [PATCH] Fix AIO-DX/DC no controller active issue When controller-1 reboot in an AIO-DX/DC setup, mgmt/infra network will temporarily go down. This is expected. However, SM couldn't determine the interface going up again when the controller-1 reboot after unlock the first time. Add code to reverify the state of down interfaces when heartbeat message is received. Closes-Bug: 1809315 Change-Id: I02c9b6bf35539df2d36ad6b665b0a5ce8f2a1c75 Signed-off-by: Bin Qian --- service-mgmt/sm-1.0.0/src/sm_failover.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/service-mgmt/sm-1.0.0/src/sm_failover.c b/service-mgmt/sm-1.0.0/src/sm_failover.c index c55bc118..f9f0cf45 100644 --- a/service-mgmt/sm-1.0.0/src/sm_failover.c +++ b/service-mgmt/sm-1.0.0/src/sm_failover.c @@ -316,8 +316,20 @@ void sm_failover_heartbeat_restore( SmFailoverInterfaceT* interface ) } else if( SM_FAILOVER_INTERFACE_DOWN == state ) { - // need to wait for if up - return; + bool enabled = true; + SmErrorT error = sm_hw_get_if_state(interface->interface_name, &enabled); + if(SM_OKAY != error) + { + DPRINTFE("Couldn't get interface (%s) state. ", interface->interface_name); + } + if(!enabled) + { + // need to wait for if up + return; + }else + { + DPRINTFI("Interface %s is verified as UP after receiving heartbeat.", interface->interface_name); + } } if(if_info->set_state(SM_FAILOVER_INTERFACE_OK)) @@ -1104,8 +1116,8 @@ void _log_nodes_state() } DPRINTFI("Host state %d, I/F state %d, peer I/F state %d", _node_comm_state, - _peer_if_state, - _host_state + _host_state, + _peer_if_state ); } // ****************************************************************************