31 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_HA 39 #define CLIENT_DB_NAME "ha_ut_client.db" 40 #define CLIENT_ENDPOINT_ADDR "0@lo:12345:34:*" 42 #define SERVER_DB_NAME "ha_ut_confd_server.db" 43 #define SERVER_STOB_NAME "ha_ut_confd_server.stob" 44 #define SERVER_ADDB_STOB_NAME "linuxstob:ha_ut_confd_server.addb_stob" 45 #define SERVER_LOG_NAME "ha_ut_confd_server.log" 46 #define SERVER_ENDPOINT_ADDR "0@lo:12345:34:1" 47 #define SERVER_ENDPOINT M0_NET_XPRT_PREFIX_DEFAULT":"SERVER_ENDPOINT_ADDR 91 .rhia_mdstore = (
void *)1
214 M0_CONF_ROOT_NODES_FID);
223 M0_CONF_PROCESS_SERVICES_FID);
245 uint32_t dev_idx, uint32_t state);
363 const struct m0_fid *pver_fid)
373 M0_CONF_PVER_SITEVS_FID,
374 M0_CONF_SITEV_RACKVS_FID,
375 M0_CONF_RACKV_ENCLVS_FID,
376 M0_CONF_ENCLV_CTRLVS_FID,
377 M0_CONF_CTRLV_DRIVEVS_FID);
427 m0_fi_enable(
"m0_ha_msg_fvec_send",
"non-trivial-fvec");
450 uint32_t dev_idx, uint32_t state)
553 M0_UT_ASSERT(pver3 != pver2 && pver3 != pver1 && pver3 != pver0);
651 #undef M0_TRACE_SUBSYSTEM const struct m0_conf_obj_type * m0_conf_obj_type(const struct m0_conf_obj *obj)
struct m0_poolmach_state * pm_state
M0_INTERNAL int m0_ha_state_get(struct m0_ha_nvec *note, struct m0_chan *chan)
#define M0_UT_CONF_PROFILE
M0_INTERNAL void m0_chan_wait(struct m0_clink *link)
static void test_poolversion_get(void)
struct m0_conf_obj * cc_root
#define M0_ALLOC_ARR(arr, nr)
const struct m0_conf_obj_type M0_CONF_OBJV_TYPE
M0_INTERNAL void m0_pool_fini(struct m0_pool *pool)
void m0_net_domain_fini(struct m0_net_domain *dom)
struct m0_ut_suite ha_state_ut
M0_INTERNAL int m0_poolmach_state_transit(struct m0_poolmach *pm, const struct m0_poolmach_event *event)
M0_INTERNAL void m0_clink_init(struct m0_clink *link, m0_chan_cb_t cb)
M0_INTERNAL void m0_clink_del_lock(struct m0_clink *link)
static struct m0_mutex chan_lock
int m0_thread_join(struct m0_thread *q)
M0_INTERNAL int m0_conf_full_load(struct m0_conf_root *r)
static void test_failvec_fetch(void)
struct m0_conf_obj rt_obj
#define M0_LOG(level,...)
static void compare_ha_state(struct m0_confc *confc, enum m0_ha_obj_state state)
M0_INTERNAL int m0_file_read(const char *path, char **out)
static void ast_thread(int _ M0_UNUSED)
static int ha_state_ut_fini(void)
static struct m0_rpc_client_ctx cctx
int m0_rpc_server_start(struct m0_rpc_server_ctx *sctx)
static struct net_test_cmd_node * node
struct m0_pool_version pool_ver
M0_INTERNAL int m0_ha_client_del(struct m0_confc *confc)
M0_INTERNAL int m0_confc_init(struct m0_confc *confc, struct m0_sm_group *sm_group, const char *confd_addr, struct m0_rpc_machine *rpc_mach, const char *local_conf)
static int ast_thread_init(void)
M0_INTERNAL int m0_conf_diter_next_sync(struct m0_conf_diter *it, bool(*filter)(const struct m0_conf_obj *obj))
#define SERVER_ENDPOINT_ADDR
M0_INTERNAL void m0_rconfc_stop_sync(struct m0_rconfc *rconfc)
static struct m0_be_emap_cursor it
struct m0_conf_obj pv_obj
M0_INTERNAL void m0_confc_fini(struct m0_confc *confc)
#define M0_THREAD_INIT(thread, TYPE, init, func, arg, namefmt,...)
static uint32_t recd_disks(const struct m0_conf_pver *pver)
M0_INTERNAL void m0_reqh_fini(struct m0_reqh *reqh)
#define CLIENT_ENDPOINT_ADDR
static void done_get_chan_fini(void)
M0_INTERNAL void m0_ha_state_set(const struct m0_ha_nvec *note)
M0_INTERNAL void m0_sm_group_fini(struct m0_sm_group *grp)
M0_INTERNAL int m0_ha_failvec_fetch(const struct m0_fid *pool_fid, struct m0_poolmach *pmach, struct m0_chan *chan)
M0_INTERNAL int m0_pool_init(struct m0_pool *pool, const struct m0_fid *id, enum m0_pver_policy_code pver_policy)
struct m0_pooldev * pst_devices_array
static void done_get_chan_init(void)
M0_INTERNAL int m0_confc_root_open(struct m0_confc *confc, struct m0_conf_root **root)
static void check_pver_subtree(struct m0_confc *confc, const struct m0_fid *pver_fid)
M0_INTERNAL int m0_conf_pver_get(struct m0_confc *confc, const struct m0_fid *pool, struct m0_conf_pver **out)
M0_INTERNAL void m0_sm_group_unlock(struct m0_sm_group *grp)
M0_INTERNAL struct m0_fid * m0_reqh2profile(struct m0_reqh *reqh)
#define SERVER_ADDB_STOB_NAME
M0_INTERNAL void m0_fid_set(struct m0_fid *fid, uint64_t container, uint64_t key)
static void ha_ut_conf_fini(struct m0_reqh *reqh)
struct m0_conf_root * root
M0_INTERNAL struct m0_confc * m0_reqh2confc(struct m0_reqh *reqh)
static void test_ha_state_set_and_get(void)
#define M0_FID_TINIT(type, container, key)
M0_INTERNAL int m0_rpc_conn_ha_subscribe(struct m0_rpc_conn *conn, struct m0_fid *svc_fid)
M0_INTERNAL void m0_fi_disable(const char *fp_func, const char *fp_tag)
static void m0_fi_enable(const char *func, const char *tag)
M0_INTERNAL void m0_chan_init(struct m0_chan *chan, struct m0_mutex *ch_guard)
static struct m0_confc * confc
M0_INTERNAL void m0_sm_group_init(struct m0_sm_group *grp)
enum m0_ha_obj_state co_ha_state
static void test_ha_state_accept(void)
static struct m0_chan chan
struct m0_rpc_conn rcx_connection
M0_INTERNAL int m0_reqh_init(struct m0_reqh *reqh, const struct m0_reqh_init_args *reqh_args)
void m0_thread_fini(struct m0_thread *q)
static void stop_rpc_client_and_server(void)
struct m0_conf_cache cc_cache
int m0_rpc_client_stop(struct m0_rpc_client_ctx *cctx)
struct m0_net_xprt * m0_net_xprt_default_get(void)
int m0_rpc_client_start(struct m0_rpc_client_ctx *cctx)
struct m0_net_xprt ** rsx_xprts
M0_INTERNAL void m0_clink_signal(struct m0_clink *clink)
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
M0_INTERNAL int m0_conf_obj_find_lock(struct m0_conf_cache *cache, const struct m0_fid *id, struct m0_conf_obj **out)
M0_INTERNAL int m0_conf_pver_fid_read(const struct m0_fid *fid, enum m0_conf_pver_kind *kind, uint64_t *container, uint64_t *key)
#define M0_CONF_CAST(ptr, type)
M0_INTERNAL int m0_fid_sscanf(const char *s, struct m0_fid *fid)
#define m0_confc_open_sync(result, origin,...)
struct m0_net_domain * rcx_net_dom
static int ha_state_ut_init(void)
M0_INTERNAL int m0_poolmach_init(struct m0_poolmach *pm, struct m0_pool_version *pver, uint32_t nr_nodes, uint32_t nr_devices, uint32_t nr_spare, uint32_t max_node_failures, uint32_t max_device_failures)
M0_INTERNAL void m0_rconfc_fini(struct m0_rconfc *rconfc)
static struct m0_net_domain client_net_dom
static struct m0_pool pool
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
void m0_clink_add_lock(struct m0_chan *chan, struct m0_clink *link)
static void ha_state_accept_1(const struct m0_fid *fid, uint32_t state)
static void local_confc_init(struct m0_confc *confc)
M0_INTERNAL uint64_t m0_poolmach_nr_dev_failures(struct m0_poolmach *pm)
M0_INTERNAL struct m0_conf_obj * m0_conf_diter_result(const struct m0_conf_diter *it)
#define m0_conf_diter_init(iter, confc, origin,...)
int m0_net_domain_init(struct m0_net_domain *dom, const struct m0_net_xprt *xprt)
struct m0_reqh_service_type m0_rpc_service_type
static void pool_machine_fid_populate(struct m0_poolmach *pool_mach)
M0_INTERNAL struct m0_locality * m0_locality0_get(void)
static struct m0_rpc_server_ctx sctx
struct m0_reqh_context cc_reqh_ctx
static struct m0_clink clink
#define M0_UT_CONF_PROCESS
struct m0_net_xprt ** m0_net_all_xprt_get(void)
M0_INTERNAL void m0_conf_diter_fini(struct m0_conf_diter *it)
static int pm_event_construct_and_apply(struct m0_poolmach *pm, uint32_t dev_idx, uint32_t state)
static struct m0_net_test_service svc
M0_INTERNAL int m0_rconfc_start(struct m0_rconfc *rconfc)
static void ast_thread_fini(void)
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
M0_INTERNAL void m0_clink_fini(struct m0_clink *link)
static char * server_argv[]
M0_INTERNAL void m0_poolmach_fini(struct m0_poolmach *pm)
M0_INTERNAL void m0_sm_group_lock(struct m0_sm_group *grp)
M0_INTERNAL int m0_ha_client_add(struct m0_confc *confc)
static void m0_fi_enable_once(const char *func, const char *tag)
M0_INTERNAL void m0_confc_close(struct m0_conf_obj *obj)
struct m0_rconfc rh_rconfc
void m0_rpc_server_stop(struct m0_rpc_server_ctx *sctx)
struct m0_rpc_machine rcx_rpc_machine
M0_INTERNAL uint32_t m0_poolmach_equeue_length(struct m0_poolmach *pm)
M0_INTERNAL void m0_rpc_conn_ha_unsubscribe(struct m0_rpc_conn *conn)
M0_INTERNAL int m0_rconfc_init(struct m0_rconfc *rconfc, const struct m0_fid *profile, struct m0_sm_group *sm_group, struct m0_rpc_machine *rmach, m0_rconfc_cb_t expired_cb, m0_rconfc_cb_t ready_cb)
static void test_ha_session_states(void)
struct m0_ha_note * nv_note
M0_INTERNAL void m0_ha_state_accept(const struct m0_ha_nvec *note, bool ignore_same_state)
static struct m0_sm_group g_grp
M0_INTERNAL void m0_sm_asts_run(struct m0_sm_group *grp)
M0_INTERNAL void m0_chan_fini_lock(struct m0_chan *chan)
static struct m0_reqh_init_args reqh_args
static bool test_is_objv(const struct m0_conf_obj *obj)
static void ha_ut_pver_kind_check(const struct m0_fid *pver_fid, enum m0_conf_pver_kind expected)
static void ha_ut_conf_init(struct m0_reqh *reqh)
struct m0_fid g_process_fid
static void start_rpc_client_and_server(void)
struct m0_motr rsx_motr_ctx
struct m0_conf_obj * cv_real
const struct m0_fid * rhia_fid