ha/service-mgmt/sm-1.0.0/src/sm_node_api.h
Bin Qian edc8a56472 Introduce failover FSM
Introduce failover FSM to handle communication failure between
controllers.
Failover FSM has 4 states:
Normal: when system running with full redundency
Fail Pending: communication failure occured
Failed: the controller is determined as failure. Its peer will
        assume service
Survived: the controller is determined as survivor. Its peer has
        failed

The controllers are in one of the below possible state pairs:
normal/normal, fail-pending/fail-pending, failed/survived

A failed controller will not resume responsbility before the
system restores its full redundency (normal/normal)

A survivor will not fail before the system restores its
full redundency (normal/normal)

Future implementation may allow an administrator to force
a failed controller become active, to manually recover
(with possiblity of losing data), should the survivor is
no longer capable to provide service.

Story: 2003577
Task: 26404

Change-Id: I51635e9e60b6fb6bad89e06c9f08d3f28e21db82
Signed-off-by: Bin Qian <bin.qian@windriver.com>
2018-09-18 08:08:40 -04:00

98 lines
3.6 KiB
C

//
// Copyright (c) 2014 Wind River Systems, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
#ifndef __SM_NODE_API_H__
#define __SM_NODE_API_H__
#include <stdbool.h>
#include "sm_types.h"
#include "sm_uuid.h"
#include "sm_limits.h"
#ifdef __cplusplus
extern "C" {
#endif
// ****************************************************************************
// Node API - Get Host Name
// ========================
extern SmErrorT sm_node_api_get_hostname( char node_name[] );
// ****************************************************************************
// ****************************************************************************
// Node API - Get Peer Name
// ========================
extern SmErrorT sm_node_api_get_peername(char peer_name[SM_NODE_NAME_MAX_CHAR]);
// ****************************************************************************
// ****************************************************************************
// Node API - Configuration Complete
// =================================
extern SmErrorT sm_node_api_config_complete( char node_name[], bool* complete );
// ****************************************************************************
// ****************************************************************************
// Node API - Add Node
// ===================
extern SmErrorT sm_node_api_add_node( char node_name[] );
// ****************************************************************************
// ****************************************************************************
// Node API - Update Node
// ======================
extern SmErrorT sm_node_api_update_node( char node_name[],
SmNodeAdminStateT admin_state, SmNodeOperationalStateT oper_state,
SmNodeAvailStatusT avail_status );
// ****************************************************************************
// ****************************************************************************
// Node API - Fail Node
// ======================
SmErrorT sm_node_api_fail_node( char node_name[] );
// ****************************************************************************
// ****************************************************************************
// Node API - Delete Node
// ======================
extern SmErrorT sm_node_api_delete_node( char node_name[] );
// ****************************************************************************
// ****************************************************************************
// Node API - Swact
// ================
extern SmErrorT sm_node_api_swact( char node_name[], bool force );
// ****************************************************************************
// ****************************************************************************
// Node API - Reboot
// =================
extern SmErrorT sm_node_api_reboot( char reason_text[] );
// ****************************************************************************
// ****************************************************************************
// Node API - Audit
// ================
extern SmErrorT sm_node_api_audit( void );
// ****************************************************************************
// ****************************************************************************
// Node API - Initialize
// =====================
extern SmErrorT sm_node_api_initialize( void );
// ****************************************************************************
// ****************************************************************************
// Node API - Finalize
// ===================
extern SmErrorT sm_node_api_finalize( void );
// ****************************************************************************
#ifdef __cplusplus
}
#endif
#endif // __SM_NODE_API_H__