Motr  M0
ha.c File Reference
#include "lib/trace.h"
#include "ha/ha.h"
#include "lib/memory.h"
#include "lib/errno.h"
#include "lib/misc.h"
#include "lib/semaphore.h"
#include "lib/string.h"
#include "module/instance.h"
#include "module/module.h"
#include "ha/link.h"
#include "ha/link_service.h"
#include "ha/entrypoint.h"
#include "conf/obj.h"
Include dependency graph for ha.c:

Go to the source code of this file.

Data Structures

struct  m0_ha_module
 
struct  ha_link_ctx
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_HA
 

Enumerations

enum  {
  HA_MAX_RPCS_IN_FLIGHT = 2, HA_DISCONNECT_TIMEOUT = 5, HA_RESEND_INTERVAL = 1, HA_RECONNECT_INTERVAL = 1,
  HA_NR_SENT_MAX = 10
}
 
enum  ha_link_ctx_type { HLX_INCOMING, HLX_OUTGOING }
 
enum  m0_ha_mod_level {
  M0_HA_MOD_LEVEL_ASSIGNS, M0_HA_MOD_LEVEL_LINK_SERVICE, M0_HA_MOD_LEVEL_LINK, M0_HA_MOD_LEVEL_ENTRYPOINT,
  M0_HA_MOD_LEVEL_STARTED
}
 

Functions

 M0_TL_DESCR_DEFINE (ha_links, "m0_ha::h_links_{incoming,outgoing}", static, struct ha_link_ctx, hlx_tlink, hlx_magic, 7, 8)
 
 M0_TL_DEFINE (ha_links, static, struct ha_link_ctx)
 
static bool ha_link_event_cb (struct m0_clink *clink)
 
static struct ha_link_ctxha_link_incoming_find (struct m0_ha *ha, const struct m0_ha_link_params *lp)
 
static bool ha_link_stop_cb (struct m0_clink *clink)
 
static int ha_link_ctx_init (struct m0_ha *ha, struct ha_link_ctx *hlx, struct m0_ha_link_cfg *hl_cfg, const struct m0_ha_link_conn_cfg *hl_conn_cfg, const struct m0_fid *process_fid, enum ha_link_ctx_type hlx_type)
 
static void ha_link_ctx_fini (struct m0_ha *ha, struct ha_link_ctx *hlx)
 
static uint64_t ha_generation_next (struct m0_ha *ha)
 
static void ha_request_received_cb (struct m0_ha_entrypoint_server *hes, const struct m0_ha_entrypoint_req *req, const struct m0_uint128 *req_id)
 
static void ha_link_conn_cfg_make (struct m0_ha_link_conn_cfg *hl_conn_cfg, const char *rpc_endpoint)
 
static bool ha_entrypoint_state_cb (struct m0_clink *clink)
 
static int ha_level_enter (struct m0_module *module)
 
static void ha_level_leave (struct m0_module *module)
 
M0_INTERNAL int m0_ha_init (struct m0_ha *ha, struct m0_ha_cfg *ha_cfg)
 
M0_INTERNAL int m0_ha_start (struct m0_ha *ha)
 
M0_INTERNAL void m0_ha_stop (struct m0_ha *ha)
 
M0_INTERNAL void m0_ha_fini (struct m0_ha *ha)
 
M0_INTERNAL struct m0_ha_linkm0_ha_connect (struct m0_ha *ha)
 
M0_INTERNAL void m0_ha_disconnect (struct m0_ha *ha)
 
M0_INTERNAL void m0_ha_disconnect_incoming (struct m0_ha *ha, struct m0_ha_link *hl)
 
static void ha_link_id_next (struct m0_ha *ha, struct m0_uint128 *id)
 
static int ha_link_incoming_create (struct m0_ha *ha, const struct m0_ha_entrypoint_req *req, struct m0_ha_link_conn_cfg *hl_conn_cfg, struct ha_link_ctx **hlx_ptr)
 
static void ha_link_handle (struct m0_ha *ha, const struct m0_uint128 *req_id, const struct m0_ha_entrypoint_req *req, struct m0_ha_entrypoint_rep *rep, struct m0_ha_link **hl_ptr)
 
void m0_ha_entrypoint_reply (struct m0_ha *ha, const struct m0_uint128 *req_id, const struct m0_ha_entrypoint_rep *rep, struct m0_ha_link **hl_ptr)
 
M0_INTERNAL void m0_ha_send (struct m0_ha *ha, struct m0_ha_link *hl, const struct m0_ha_msg *msg, uint64_t *tag)
 
M0_INTERNAL void m0_ha_delivered (struct m0_ha *ha, struct m0_ha_link *hl, struct m0_ha_msg *msg)
 
static int ha_mod_level_enter (struct m0_module *module)
 
static void ha_mod_level_leave (struct m0_module *module)
 
M0_INTERNAL void m0_ha_flush (struct m0_ha *ha, struct m0_ha_link *hl)
 
M0_INTERNAL void m0_ha_process_failed (struct m0_ha *ha, const struct m0_fid *process_fid)
 
M0_INTERNAL struct m0_ha_linkm0_ha_outgoing_link (struct m0_ha *ha)
 
M0_INTERNAL struct m0_rpc_sessionm0_ha_outgoing_session (struct m0_ha *ha)
 
M0_INTERNAL void m0_ha_rpc_endpoint (struct m0_ha *ha, struct m0_ha_link *hl, char *buf, m0_bcount_t buf_len)
 
M0_INTERNAL int m0_ha_mod_init (void)
 
M0_INTERNAL void m0_ha_mod_fini (void)
 

Variables

static const struct m0_modlev ha_levels []
 
static const struct m0_modlev ha_mod_levels []