|
M0_INTERNAL void | m0_ha_cookie_init (struct m0_ha_cookie *hc) |
|
M0_INTERNAL void | m0_ha_cookie_fini (struct m0_ha_cookie *hc) |
|
M0_INTERNAL void | m0_ha_cookie_record (struct m0_ha_cookie *hc) |
|
M0_INTERNAL bool | m0_ha_cookie_is_eq (const struct m0_ha_cookie *a, const struct m0_ha_cookie *b) |
|
M0_INTERNAL void | m0_ha_cookie_from_xc (struct m0_ha_cookie *hc, const struct m0_ha_cookie_xc *hc_xc) |
|
M0_INTERNAL void | m0_ha_cookie_to_xc (const struct m0_ha_cookie *hc, struct m0_ha_cookie_xc *hc_xc) |
|
struct m0_ha_cookie_xc | M0_XCA_DOMAIN (rpc) |
|
int | main (int argc, char *argv[]) |
|
static struct ha_entrypoint_service * | ha_entrypoint_service_container (struct m0_reqh_service *service) |
|
static void | ha_entrypoint_service_init (struct m0_reqh_service *service) |
|
static void | ha_entrypoint_service_fini (struct m0_reqh_service *service) |
|
static int | ha_entrypoint_service_start (struct m0_reqh_service *service) |
|
static int | ha_entrypoint_service_fop_accept (struct m0_reqh_service *service, struct m0_fop *fop) |
|
static void | ha_entrypoint_service_stop (struct m0_reqh_service *service) |
|
static int | ha_entrypoint_service_allocate (struct m0_reqh_service **service, const struct m0_reqh_service_type *stype) |
|
M0_INTERNAL int | m0_ha_entrypoint_service_init (struct m0_reqh_service **service, struct m0_reqh *reqh) |
|
M0_INTERNAL void | m0_ha_entrypoint_service_fini (struct m0_reqh_service *he_service) |
|
| M0_TL_DESCR_DEFINE (hes_req, "m0_ha_entrypoint_server::hes_requests", static, struct ha_entrypoint_server_fom, esf_tlink, esf_magic, 10, 11) |
|
| M0_TL_DEFINE (hes_req, static, struct ha_entrypoint_server_fom) |
|
M0_INTERNAL int | m0_ha_entrypoint_server_init (struct m0_ha_entrypoint_server *hes, struct m0_ha_entrypoint_server_cfg *hes_cfg) |
|
M0_INTERNAL void | m0_ha_entrypoint_server_fini (struct m0_ha_entrypoint_server *hes) |
|
M0_INTERNAL void | m0_ha_entrypoint_server_start (struct m0_ha_entrypoint_server *hes) |
|
M0_INTERNAL void | m0_ha_entrypoint_server_stop (struct m0_ha_entrypoint_server *hes) |
|
static struct ha_entrypoint_server_fom * | ha_entrypoint_server_find (struct m0_ha_entrypoint_server *hes, const struct m0_uint128 *req_id) |
|
static void | ha_entrypoint_server_register (struct m0_ha_entrypoint_server *hes, struct ha_entrypoint_server_fom *server_fom) |
|
static void | ha_entrypoint_server_deregister (struct m0_ha_entrypoint_server *hes, struct ha_entrypoint_server_fom *server_fom) |
|
M0_INTERNAL void | m0_ha_entrypoint_server_reply (struct m0_ha_entrypoint_server *hes, const struct m0_uint128 *req_id, const struct m0_ha_entrypoint_rep *rep) |
|
M0_INTERNAL const struct m0_ha_entrypoint_req * | m0_ha_entrypoint_server_request_find (struct m0_ha_entrypoint_server *hes, const struct m0_uint128 *req_id) |
|
static bool | ha_entrypoint_client_rlink_cb (struct m0_clink *clink) |
|
M0_INTERNAL int | m0_ha_entrypoint_client_init (struct m0_ha_entrypoint_client *ecl, const char *ep, struct m0_ha_entrypoint_client_cfg *ecl_cfg) |
|
M0_INTERNAL void | m0_ha_entrypoint_client_fini (struct m0_ha_entrypoint_client *ecl) |
|
static void | ha_entrypoint_client_replied (struct m0_rpc_item *item) |
|
static void | ha_entrypoint_client_fop_release (struct m0_ref *ref) |
|
static int | ha_entrypoint_client_fom_tick (struct m0_fom *fom) |
|
static void | ha_entrypoint_client_fom_fini (struct m0_fom *fom) |
|
static size_t | ha_entrypoint_client_fom_locality (const struct m0_fom *fom) |
|
M0_INTERNAL void | m0_ha_entrypoint_client_request (struct m0_ha_entrypoint_client *ecl) |
|
M0_INTERNAL void | m0_ha_entrypoint_client_start (struct m0_ha_entrypoint_client *ecl) |
|
static bool | ha_entrypoint_client_start_check (struct m0_clink *clink) |
|
static bool | ha_entrypoint_client_stop_check (struct m0_clink *clink) |
|
M0_INTERNAL void | m0_ha_entrypoint_client_start_sync (struct m0_ha_entrypoint_client *ecl) |
|
M0_INTERNAL void | m0_ha_entrypoint_client_stop (struct m0_ha_entrypoint_client *ecl) |
|
M0_INTERNAL struct m0_chan * | m0_ha_entrypoint_client_chan (struct m0_ha_entrypoint_client *ecl) |
|
M0_INTERNAL enum m0_ha_entrypoint_client_state | m0_ha_entrypoint_client_state_get (struct m0_ha_entrypoint_client *ecl) |
|
M0_INTERNAL int | m0_ha_entrypoint_mod_init (void) |
|
M0_INTERNAL void | m0_ha_entrypoint_mod_fini (void) |
|
static size_t | ha_entrypoint_home_locality (const struct m0_fom *fom) |
|
static void | ha_entrypoint_fom_fini (struct m0_fom *fom) |
|
static int | ha_entrypoint_get_fom_tick (struct m0_fom *fom) |
|
static int | ha_entrypoint_fom_create (struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh) |
|
M0_INTERNAL void | m0_ha_entrypoint_fops_init (void) |
|
M0_INTERNAL void | m0_ha_entrypoint_fops_fini (void) |
|
M0_INTERNAL int | m0_ha_entrypoint_req2fop (const struct m0_ha_entrypoint_req *req, struct m0_ha_entrypoint_req_fop *req_fop) |
|
M0_INTERNAL int | m0_ha_entrypoint_fop2req (const struct m0_ha_entrypoint_req_fop *req_fop, const char *rpc_endpoint, struct m0_ha_entrypoint_req *req) |
|
M0_INTERNAL int | m0_ha_entrypoint_fop2rep (const struct m0_ha_entrypoint_rep_fop *rep_fop, struct m0_ha_entrypoint_rep *rep) |
|
M0_INTERNAL int | m0_ha_entrypoint_rep2fop (const struct m0_ha_entrypoint_rep *rep, struct m0_ha_entrypoint_rep_fop *rep_fop) |
|
M0_INTERNAL void | m0_ha_entrypoint_rep_free (struct m0_ha_entrypoint_rep *rep) |
|
M0_INTERNAL void | m0_ha_entrypoint_req_free (struct m0_ha_entrypoint_req *req) |
|
M0_INTERNAL int | m0_ha_entrypoint_rep_copy (struct m0_ha_entrypoint_rep *to, struct m0_ha_entrypoint_rep *from) |
|
| M0_TL_DESCR_DEFINE (hg_client, "ha global clients list", static, struct ha_client, hc_link, hc_magic, M0_HA_CLIENT_MAGIC, M0_HA_CLIENT_HEAD_MAGIC) |
|
| M0_TL_DEFINE (hg_client, static, struct ha_client) |
|
| M0_TL_DESCR_DEFINE (ham, "ha epoch monitor", static, struct m0_ha_epoch_monitor, hem_linkage, hem_magix, M0_HA_EPOCH_MONITOR_MAGIC, M0_HA_DOMAIN_MAGIC) |
|
| M0_TL_DEFINE (ham, static, struct m0_ha_epoch_monitor) |
|
static int | default_mon_future (struct m0_ha_epoch_monitor *self, uint64_t epoch, const struct m0_rpc_item *item) |
|
M0_INTERNAL void | m0_ha_domain_init (struct m0_ha_domain *dom, uint64_t epoch) |
|
M0_INTERNAL void | m0_ha_domain_fini (struct m0_ha_domain *dom) |
|
M0_INTERNAL void | m0_ha_domain_monitor_add (struct m0_ha_domain *dom, struct m0_ha_epoch_monitor *mon) |
|
M0_INTERNAL void | m0_ha_domain_monitor_del (struct m0_ha_domain *dom, struct m0_ha_epoch_monitor *mon) |
|
M0_INTERNAL uint64_t | m0_ha_domain_get_read (struct m0_ha_domain *dom) |
|
M0_INTERNAL void | m0_ha_domain_put_read (struct m0_ha_domain *dom) |
|
M0_INTERNAL uint64_t | m0_ha_domain_get_write (struct m0_ha_domain *dom) |
|
M0_INTERNAL void | m0_ha_domain_put_write (struct m0_ha_domain *dom, uint64_t epoch) |
|
M0_INTERNAL int | m0_ha_global_init (void) |
|
M0_INTERNAL void | m0_ha_global_fini (void) |
|
static void | ha_global_lock (struct ha_global *hg) |
|
static void | ha_global_unlock (struct ha_global *hg) |
|
static void | ha_client_release (struct m0_ref *ref) |
|
M0_INTERNAL int | m0_ha_client_add (struct m0_confc *confc) |
|
M0_INTERNAL int | m0_ha_client_del (struct m0_confc *confc) |
|
M0_INTERNAL void | m0_ha_clients_iterate (m0_ha_client_cb_t iter, const void *data, uint64_t data2) |
|
M0_INTERNAL int | m0_ha_epoch_check (const struct m0_rpc_item *item) |
|
| 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_ctx * | ha_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_link * | m0_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_link * | m0_ha_outgoing_link (struct m0_ha *ha) |
|
M0_INTERNAL struct m0_rpc_session * | m0_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) |
|
| M0_BOB_DEFINE (static, &halon_interface_bob_type, m0_halon_interface_internal) |
|
static bool | halon_interface_is_compatible (struct m0_halon_interface *hi, const char *build_git_rev_id, const char *build_configure_opts, bool disable_compat_check) |
|
static void | halon_interface_parse_debug_options (struct m0_halon_interface *hi, const char *debug_options) |
|
static struct m0_halon_interface_internal * | halon_interface_ha2hii (struct m0_ha *ha) |
|
static void | halon_interface_process_failure_check (struct m0_halon_interface_internal *hii, struct m0_ha_msg *msg) |
|
static void | halon_interface_entrypoint_request_cb (struct m0_ha *ha, const struct m0_ha_entrypoint_req *req, const struct m0_uint128 *req_id) |
|
static void | halon_interface_entrypoint_replied_cb (struct m0_ha *ha, struct m0_ha_entrypoint_rep *rep) |
|
static void | halon_interface_msg_received_cb (struct m0_ha *ha, struct m0_ha_link *hl, struct m0_ha_msg *msg, uint64_t tag) |
|
static void | halon_interface_msg_is_delivered_cb (struct m0_ha *ha, struct m0_ha_link *hl, uint64_t tag) |
|
static void | halon_interface_msg_is_not_delivered_cb (struct m0_ha *ha, struct m0_ha_link *hl, uint64_t tag) |
|
static void | halon_interface_link_connected_cb (struct m0_ha *ha, const struct m0_uint128 *req_id, struct m0_ha_link *hl) |
|
static void | halon_interface_link_reused_cb (struct m0_ha *ha, const struct m0_uint128 *req_id, struct m0_ha_link *hl) |
|
static void | halon_interface_link_absent_cb (struct m0_ha *ha, const struct m0_uint128 *req_id) |
|
static void | halon_interface_link_is_disconnecting_cb (struct m0_ha *ha, struct m0_ha_link *hl) |
|
static void | halon_interface_link_disconnected_cb (struct m0_ha *ha, struct m0_ha_link *hl) |
|
int | m0_halon_interface_init (struct m0_halon_interface **hi_out, const char *build_git_rev_id, const char *build_configure_opts, const char *debug_options, const char *node_uuid) |
|
void | m0_halon_interface_fini (struct m0_halon_interface *hi) |
|
static void | halon_interface_process_event (struct m0_halon_interface_internal *hii, enum m0_conf_ha_process_event event) |
|
static void | halon_interface_service_event (struct m0_halon_interface_internal *hii, enum m0_conf_ha_service_event event) |
|
static int | halon_interface_level_enter (struct m0_module *module) |
|
static void | halon_interface_level_leave (struct m0_module *module) |
|
int | m0_halon_interface_start (struct m0_halon_interface *hi, const char *local_rpc_endpoint, const struct m0_fid *process_fid, const struct m0_fid *ha_service_fid, const struct m0_fid *rm_service_fid, void(*entrypoint_request_cb)(struct m0_halon_interface *hi, const struct m0_uint128 *req_id, const char *remote_rpc_endpoint, const struct m0_fid *process_fid, const char *git_rev_id, uint64_t pid, bool first_request), void(*msg_received_cb)(struct m0_halon_interface *hi, struct m0_ha_link *hl, const struct m0_ha_msg *msg, uint64_t tag), void(*msg_is_delivered_cb)(struct m0_halon_interface *hi, struct m0_ha_link *hl, uint64_t tag), void(*msg_is_not_delivered_cb)(struct m0_halon_interface *hi, struct m0_ha_link *hl, uint64_t tag), void(*link_connected_cb)(struct m0_halon_interface *hi, const struct m0_uint128 *req_id, struct m0_ha_link *link), void(*link_reused_cb)(struct m0_halon_interface *hi, const struct m0_uint128 *req_id, struct m0_ha_link *link), void(*link_absent_cb)(struct m0_halon_interface *hi, const struct m0_uint128 *req_id), void(*link_is_disconnecting_cb)(struct m0_halon_interface *hi, struct m0_ha_link *link), void(*link_disconnected_cb)(struct m0_halon_interface *hi, struct m0_ha_link *link)) |
|
void | m0_halon_interface_stop (struct m0_halon_interface *hi) |
|
void | m0_halon_interface_entrypoint_reply (struct m0_halon_interface *hi, const struct m0_uint128 *req_id, int rc, uint32_t confd_nr, const struct m0_fid *confd_fid_data, const char **confd_eps_data, uint32_t confd_quorum, const struct m0_fid *rm_fid, const char *rm_eps) |
|
void | m0_halon_interface_send (struct m0_halon_interface *hi, struct m0_ha_link *hl, const struct m0_ha_msg *msg, uint64_t *tag) |
|
void | m0_halon_interface_delivered (struct m0_halon_interface *hi, struct m0_ha_link *hl, const struct m0_ha_msg *msg) |
|
void | m0_halon_interface_disconnect (struct m0_halon_interface *hi, struct m0_ha_link *hl) |
|
static bool | halon_interface_is_working (struct m0_halon_interface_internal *hii) |
|
struct m0_rpc_machine * | m0_halon_interface_rpc_machine (struct m0_halon_interface *hi) |
|
struct m0_reqh * | m0_halon_interface_reqh (struct m0_halon_interface *hi) |
|
struct m0_spiel * | m0_halon_interface_spiel (struct m0_halon_interface *hi) |
|
M0_INTERNAL int | m0_halon_interface_thread_adopt (struct m0_halon_interface *hi, struct m0_thread *thread) |
|
M0_INTERNAL void | m0_halon_interface_thread_shun (void) |
|
| M0_BASSERT (ARRAY_SIZE(ha_link_sm_states)==M0_HA_LINK_STATE_NR) |
|
static void | ha_link_outgoing_fom_wakeup (struct m0_ha_link *hl) |
|
static bool | ha_link_rpc_wait_cb (struct m0_clink *clink) |
|
static bool | ha_link_quiesce_wait_cb (struct m0_clink *clink) |
|
M0_INTERNAL int | m0_ha_link_init (struct m0_ha_link *hl, struct m0_ha_link_cfg *hl_cfg) |
|
M0_INTERNAL void | m0_ha_link_fini (struct m0_ha_link *hl) |
|
static int | ha_link_conn_cfg_copy (struct m0_ha_link_conn_cfg *dst, const struct m0_ha_link_conn_cfg *src) |
|
static void | ha_link_conn_cfg_free (struct m0_ha_link_conn_cfg *hl_conn_cfg) |
|
static void | ha_link_tags_apply (struct m0_ha_link *hl, const struct m0_ha_link_params *lp) |
|
M0_INTERNAL void | m0_ha_link_start (struct m0_ha_link *hl, struct m0_ha_link_conn_cfg *hl_conn_cfg) |
|
M0_INTERNAL void | m0_ha_link_stop (struct m0_ha_link *hl, struct m0_clink *clink) |
|
M0_INTERNAL void | m0_ha_link_reconnect_begin (struct m0_ha_link *hl, struct m0_ha_link_params *lp) |
|
M0_INTERNAL void | m0_ha_link_reconnect_end (struct m0_ha_link *hl, const struct m0_ha_link_conn_cfg *hl_conn_cfg) |
|
M0_INTERNAL void | m0_ha_link_reconnect_cancel (struct m0_ha_link *hl) |
|
M0_INTERNAL void | m0_ha_link_reconnect_params (const struct m0_ha_link_params *lp_alive, struct m0_ha_link_params *lp_alive_new, struct m0_ha_link_params *lp_dead_new, const struct m0_uint128 *id_alive, const struct m0_uint128 *id_dead, const struct m0_uint128 *id_connection) |
|
M0_INTERNAL struct m0_chan * | m0_ha_link_chan (struct m0_ha_link *hl) |
|
M0_INTERNAL enum m0_ha_link_state | m0_ha_link_state_get (struct m0_ha_link *hl) |
|
M0_INTERNAL const char * | m0_ha_link_state_name (enum m0_ha_link_state state) |
|
M0_INTERNAL void | m0_ha_link_send (struct m0_ha_link *hl, const struct m0_ha_msg *msg, uint64_t *tag) |
|
M0_INTERNAL struct m0_ha_msg * | m0_ha_link_recv (struct m0_ha_link *hl, uint64_t *tag) |
|
M0_INTERNAL void | m0_ha_link_delivered (struct m0_ha_link *hl, struct m0_ha_msg *msg) |
|
M0_INTERNAL bool | m0_ha_link_msg_is_delivered (struct m0_ha_link *hl, uint64_t tag) |
|
M0_INTERNAL uint64_t | m0_ha_link_delivered_consume (struct m0_ha_link *hl) |
|
M0_INTERNAL uint64_t | m0_ha_link_not_delivered_consume (struct m0_ha_link *hl) |
|
static void | ha_link_wait (struct ha_link_wait_ctx *wait_ctx, bool(*check)(struct m0_clink *clink)) |
|
static bool | ha_link_wait_delivery_check (struct m0_clink *clink) |
|
M0_INTERNAL void | m0_ha_link_wait_delivery (struct m0_ha_link *hl, uint64_t tag) |
|
static bool | ha_link_wait_arrival_check (struct m0_clink *clink) |
|
M0_INTERNAL void | m0_ha_link_wait_arrival (struct m0_ha_link *hl) |
|
static bool | ha_link_wait_confirmation_check (struct m0_clink *clink) |
|
M0_INTERNAL void | m0_ha_link_wait_confirmation (struct m0_ha_link *hl, uint64_t tag) |
|
M0_INTERNAL void | m0_ha_link_flush (struct m0_ha_link *hl) |
|
M0_INTERNAL void | m0_ha_link_cb_disconnecting (struct m0_ha_link *hl) |
|
M0_INTERNAL void | m0_ha_link_cb_reused (struct m0_ha_link *hl) |
|
static void | ha_link_tags_update (struct m0_ha_link *hl, uint64_t out_next, uint64_t in_delivered) |
|
static void | ha_link_tags_in_out (struct m0_ha_link *hl, uint64_t *out_next, uint64_t *in_delivered) |
|
static void | ha_link_msg_received (struct m0_ha_link *hl, const struct m0_ha_msg *msg) |
|
static void | ha_link_msg_recv_or_delivery_broadcast (struct m0_ha_link *hl) |
|
static struct ha_link_incoming_fom * | ha_link_incoming_fom_container (struct m0_fom *fom) |
|
static int | ha_link_incoming_fom_tick (struct m0_fom *fom) |
|
static void | ha_link_incoming_fom_fini (struct m0_fom *fom) |
|
static size_t | ha_link_incoming_fom_locality (const struct m0_fom *fom) |
|
static int | ha_link_incoming_fom_create (struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh) |
|
static void | ha_link_outgoing_item_sent (struct m0_rpc_item *item) |
|
static void | ha_link_outgoing_item_replied (struct m0_rpc_item *item) |
|
static void | ha_link_outgoing_fop_release (struct m0_ref *ref) |
|
static int | ha_link_outgoing_fop_send (struct m0_ha_link *hl) |
|
static bool | ha_link_backoff_check (struct m0_ha_link *hl, int rc, uint64_t *nr, int *old_rc, uint64_t *old_nr) |
|
static int | ha_link_outgoing_fop_replied (struct m0_ha_link *hl) |
|
static bool | ha_link_q_in_confirm_all (struct m0_ha_link *hl) |
|
static void | ha_link_cb_disconnecting_reused (struct m0_ha_link *hl) |
|
static void | ha_link_outgoing_reconnect_timeout (struct m0_sm_timer *timer) |
|
static int | ha_link_outgoing_fom_tick (struct m0_fom *fom) |
|
static void | ha_link_outgoing_fom_wakeup_ast (struct m0_sm_group *gr, struct m0_sm_ast *ast) |
|
static void | ha_link_outgoing_fom_fini (struct m0_fom *fom) |
|
static size_t | ha_link_outgoing_fom_locality (const struct m0_fom *fom) |
|
static int | ha_link_outgoing_fom_create (struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh) |
|
M0_INTERNAL struct m0_rpc_session * | m0_ha_link_rpc_session (struct m0_ha_link *hl) |
|
M0_INTERNAL void | m0_ha_link_rpc_endpoint (struct m0_ha_link *hl, char *buf, m0_bcount_t buf_len) |
|
M0_INTERNAL int | m0_ha_link_mod_init (void) |
|
M0_INTERNAL void | m0_ha_link_mod_fini (void) |
|
M0_INTERNAL void | m0_ha_link_quiesce (struct m0_ha_link *hl) |
|
M0_INTERNAL void | m0_ha_link_tags_initial (struct m0_ha_link_tags *tags, bool tag_even) |
|
M0_INTERNAL bool | m0_ha_link_tags_eq (const struct m0_ha_link_tags *tags1, const struct m0_ha_link_tags *tags2) |
|
M0_INTERNAL void | m0_ha_link_params_invert (struct m0_ha_link_params *dst, const struct m0_ha_link_params *src) |
|
M0_INTERNAL int | m0_ha_link_fops_init (void) |
|
M0_INTERNAL void | m0_ha_link_fops_fini (void) |
|
| M0_TL_DESCR_DEFINE (ha_link_svc, "ha_link_service::hls_links", static, struct m0_ha_link, hln_service_link, hln_service_magic, M0_HA_LINK_SERVICE_LINK_MAGIC, M0_HA_LINK_SERVICE_HEAD_MAGIC) |
|
| M0_TL_DEFINE (ha_link_svc, static, struct m0_ha_link) |
|
| M0_BOB_DEFINE (static inline, &ha_link_service_bob_type, ha_link_service) |
|
static struct ha_link_service * | ha_link_service_container (struct m0_reqh_service *service) |
|
static void | ha_link_service_init (struct m0_reqh_service *service) |
|
static void | ha_link_service_fini (struct m0_reqh_service *service) |
|
static int | ha_link_service_start (struct m0_reqh_service *service) |
|
static int | ha_link_service_fop_accept (struct m0_reqh_service *service, struct m0_fop *fop) |
|
static void | ha_link_service_stop (struct m0_reqh_service *service) |
|
static struct m0_ha_link * | ha_link_service_find (struct ha_link_service *hl_service, const struct m0_uint128 *link_id, struct m0_uint128 *connection_id) |
|
static void | ha_link_service_get (struct ha_link_service *hl_service, struct m0_ha_link *hl) |
|
M0_INTERNAL struct m0_ha_link * | m0_ha_link_service_find_get (struct m0_reqh_service *service, const struct m0_uint128 *link_id, struct m0_uint128 *connection_id) |
|
M0_INTERNAL void | m0_ha_link_service_put (struct m0_reqh_service *service, struct m0_ha_link *hl) |
|
M0_INTERNAL void | m0_ha_link_service_quiesce (struct m0_reqh_service *service, struct m0_ha_link *hl, struct m0_chan *chan) |
|
M0_INTERNAL void | m0_ha_link_service_register (struct m0_reqh_service *service, struct m0_ha_link *hl, const struct m0_uint128 *link_id, const struct m0_uint128 *connection_id) |
|
M0_INTERNAL void | m0_ha_link_service_deregister (struct m0_reqh_service *service, struct m0_ha_link *hl) |
|
static int | ha_link_service_allocate (struct m0_reqh_service **service, const struct m0_reqh_service_type *stype) |
|
M0_INTERNAL int | m0_ha_link_service_init (struct m0_reqh_service **hl_service, struct m0_reqh *reqh) |
|
M0_INTERNAL void | m0_ha_link_service_fini (struct m0_reqh_service *hl_service) |
|
M0_INTERNAL int | m0_ha_link_service_mod_init (void) |
|
M0_INTERNAL void | m0_ha_link_service_mod_fini (void) |
|
static bool | ha_lq_tags_invariant (const struct m0_ha_link_tags *tags) |
|
M0_INTERNAL bool | m0_ha_lq_invariant (const struct m0_ha_lq *lq) |
|
M0_INTERNAL void | m0_ha_lq_init (struct m0_ha_lq *lq, const struct m0_ha_lq_cfg *lq_cfg) |
|
M0_INTERNAL void | m0_ha_lq_fini (struct m0_ha_lq *lq) |
|
M0_INTERNAL void | m0_ha_lq_tags_get (const struct m0_ha_lq *lq, struct m0_ha_link_tags *tags) |
|
M0_INTERNAL void | m0_ha_lq_tags_set (struct m0_ha_lq *lq, const struct m0_ha_link_tags *tags) |
|
M0_INTERNAL bool | m0_ha_lq_has_tag (const struct m0_ha_lq *lq, uint64_t tag) |
|
M0_INTERNAL struct m0_ha_msg * | m0_ha_lq_msg (struct m0_ha_lq *lq, uint64_t tag) |
|
M0_INTERNAL struct m0_ha_msg * | m0_ha_lq_msg_next (struct m0_ha_lq *lq, const struct m0_ha_msg *cur) |
|
M0_INTERNAL struct m0_ha_msg * | m0_ha_lq_msg_prev (struct m0_ha_lq *lq, const struct m0_ha_msg *cur) |
|
M0_INTERNAL bool | m0_ha_lq_has_next (const struct m0_ha_lq *lq) |
|
M0_INTERNAL bool | m0_ha_lq_is_delivered (const struct m0_ha_lq *lq, uint64_t tag) |
|
M0_INTERNAL uint64_t | m0_ha_lq_tag_assign (const struct m0_ha_lq *lq) |
|
M0_INTERNAL uint64_t | m0_ha_lq_tag_next (const struct m0_ha_lq *lq) |
|
M0_INTERNAL uint64_t | m0_ha_lq_tag_delivered (const struct m0_ha_lq *lq) |
|
M0_INTERNAL uint64_t | m0_ha_lq_tag_confirmed (const struct m0_ha_lq *lq) |
|
M0_INTERNAL uint64_t | m0_ha_lq_enqueue (struct m0_ha_lq *lq, const struct m0_ha_msg *msg) |
|
M0_INTERNAL struct m0_ha_msg * | m0_ha_lq_next (struct m0_ha_lq *lq) |
|
M0_INTERNAL bool | m0_ha_lq_try_unnext (struct m0_ha_lq *lq) |
|
M0_INTERNAL void | m0_ha_lq_mark_delivered (struct m0_ha_lq *lq, uint64_t tag) |
|
M0_INTERNAL uint64_t | m0_ha_lq_dequeue (struct m0_ha_lq *lq) |
|
M0_INTERNAL uint64_t | m0_ha_msg_tag (const struct m0_ha_msg *msg) |
|
M0_INTERNAL enum m0_ha_msg_type | m0_ha_msg_type_get (const struct m0_ha_msg *msg) |
|
M0_INTERNAL bool | m0_ha_msg_eq (const struct m0_ha_msg *msg1, const struct m0_ha_msg *msg2) |
|
M0_INTERNAL void | m0_ha_msg_debug_print (const struct m0_ha_msg *msg, const char *prefix) |
|
| M0_TL_DESCR_DEFINE (ha_mq, "m0_ha_msg_queue::mq_queue", static, struct m0_ha_msg_qitem, hmq_link, hmq_magic, M0_HA_MSG_QITEM_MAGIC, M0_HA_MSG_QUEUE_HEAD_MAGIC) |
|
| M0_TL_DEFINE (ha_mq, static, struct m0_ha_msg_qitem) |
|
M0_INTERNAL void | m0_ha_msg_queue_init (struct m0_ha_msg_queue *mq, struct m0_ha_msg_queue_cfg *cfg) |
|
M0_INTERNAL void | m0_ha_msg_queue_fini (struct m0_ha_msg_queue *mq) |
|
M0_INTERNAL struct m0_ha_msg_qitem * | m0_ha_msg_queue_alloc (struct m0_ha_msg_queue *mq) |
|
M0_INTERNAL void | m0_ha_msg_queue_free (struct m0_ha_msg_queue *mq, struct m0_ha_msg_qitem *qitem) |
|
M0_INTERNAL void | m0_ha_msg_queue_enqueue (struct m0_ha_msg_queue *mq, struct m0_ha_msg_qitem *qitem) |
|
M0_INTERNAL struct m0_ha_msg_qitem * | m0_ha_msg_queue_dequeue (struct m0_ha_msg_queue *mq) |
|
M0_INTERNAL void | m0_ha_msg_queue_push_front (struct m0_ha_msg_queue *mq, struct m0_ha_msg_qitem *qitem) |
|
M0_INTERNAL bool | m0_ha_msg_queue_is_empty (struct m0_ha_msg_queue *mq) |
|
M0_INTERNAL struct m0_ha_msg_qitem * | m0_ha_msg_queue_find (struct m0_ha_msg_queue *mq, uint64_t tag) |
|
M0_INTERNAL struct m0_ha_msg_qitem * | m0_ha_msg_queue_next (struct m0_ha_msg_queue *mq, const struct m0_ha_msg_qitem *cur) |
|
M0_INTERNAL struct m0_ha_msg_qitem * | m0_ha_msg_queue_prev (struct m0_ha_msg_queue *mq, const struct m0_ha_msg_qitem *cur) |
|
void | m0_ha_ut_cookie (void) |
|
static void | ha_ut_entrypoint_request_arrived (struct m0_ha_entrypoint_server *hes, const struct m0_ha_entrypoint_req *req, const struct m0_uint128 *req_id) |
|
static void | ha_ut_entrypoint_reply_init (struct ha_ut_entrypoint_usecase_ctx *uctx) |
|
static void | ha_ut_entrypoint_reply_fini (struct ha_ut_entrypoint_usecase_ctx *uctx) |
|
static void | ha_ut_entrypoint_reply_check (struct ha_ut_entrypoint_usecase_ctx *uctx, struct m0_ha_entrypoint_rep *rep) |
|
static void | ha_ut_entrypoint_server_start (struct ha_ut_entrypoint_usecase_ctx *uctx, struct m0_ha_ut_rpc_ctx *ctx, struct m0_ha_entrypoint_server *esr) |
|
static void | ha_ut_entrypoint_server_stop (struct ha_ut_entrypoint_usecase_ctx *uctx, struct m0_ha_entrypoint_server *esr) |
|
static void | ha_ut_entrypoint_client_start (struct ha_ut_entrypoint_usecase_ctx *uctx, struct m0_ha_ut_rpc_ctx *ctx, struct m0_ha_entrypoint_client *ecl) |
|
static void | ha_ut_entrypoint_client_stop (struct ha_ut_entrypoint_usecase_ctx *uctx, struct m0_ha_entrypoint_client *ecl) |
|
void | m0_ha_ut_entrypoint_usecase (void) |
|
static bool | ha_ut_entrypoint_client_cb (struct m0_clink *clink) |
|
void | m0_ha_ut_entrypoint_client (void) |
|
static struct ha_ut_usecase_ctx * | ha_ut_ha2usecase_ctx (struct m0_ha *ha) |
|
static void | ha_ut_usecase_link_check (struct ha_ut_usecase_ctx *huc, struct m0_ha_link *hl) |
|
static void | ha_ut_usecase_entrypoint_request (struct m0_ha *ha, const struct m0_ha_entrypoint_req *req, const struct m0_uint128 *req_id) |
|
static void | ha_ut_usecase_entrypoint_replied (struct m0_ha *ha, struct m0_ha_entrypoint_rep *rep) |
|
static void | ha_ut_usecase_msg_received (struct m0_ha *ha, struct m0_ha_link *hl, struct m0_ha_msg *msg, uint64_t tag) |
|
static void | ha_ut_usecase_msg_is_delivered (struct m0_ha *ha, struct m0_ha_link *hl, uint64_t tag) |
|
static void | ha_ut_usecase_msg_is_not_delivered (struct m0_ha *ha, struct m0_ha_link *hl, uint64_t tag) |
|
static void | ha_ut_usecase_link_connected (struct m0_ha *ha, const struct m0_uint128 *req_id, struct m0_ha_link *hl) |
|
static void | ha_ut_usecase_link_reused (struct m0_ha *ha, const struct m0_uint128 *req_id, struct m0_ha_link *hl) |
|
static void | ha_ut_usecase_link_is_disconnecting (struct m0_ha *ha, struct m0_ha_link *hl) |
|
static void | ha_ut_usecase_link_disconnected (struct m0_ha *ha, struct m0_ha_link *hl) |
|
static bool | ha_ut_ha_wait_available (struct m0_clink *clink) |
|
void | m0_ha_ut_ha_usecase (void) |
|
M0_INTERNAL void | m0_ha_ut_rpc_ctx_init (struct m0_ha_ut_rpc_ctx *ctx) |
|
M0_INTERNAL void | m0_ha_ut_rpc_ctx_fini (struct m0_ha_ut_rpc_ctx *ctx) |
|
M0_INTERNAL void | m0_ha_ut_rpc_session_ctx_init (struct m0_ha_ut_rpc_session_ctx *sctx, struct m0_ha_ut_rpc_ctx *ctx) |
|
M0_INTERNAL void | m0_ha_ut_rpc_session_ctx_fini (struct m0_ha_ut_rpc_session_ctx *sctx) |
|
static void | ha_ut_link_conn_cfg_create (struct m0_ha_link_conn_cfg *hl_conn_cfg, struct m0_uint128 *id_local, struct m0_uint128 *id_remote, struct m0_uint128 *id_connection, bool tag_even, const char *ep) |
|
static void | ha_ut_link_cfg_create (struct m0_ha_link_cfg *hl_cfg, struct m0_ha_ut_rpc_ctx *rpc_ctx, struct m0_reqh_service *hl_service) |
|
static void | ha_ut_link_conn_cfg_free (struct m0_ha_link_conn_cfg *hl_conn_cfg) |
|
static void | ha_ut_link_init (struct ha_ut_link_ctx *link_ctx, struct m0_ha_ut_rpc_ctx *rpc_ctx, struct m0_reqh_service *hl_service, struct m0_uint128 *id_local, struct m0_uint128 *id_remote, struct m0_uint128 *id_connection, bool tag_even, bool start) |
|
static void | ha_ut_link_fini (struct ha_ut_link_ctx *link_ctx) |
|
static void | ha_ut_link_set_some_msg (struct m0_ha_msg *msg) |
|
void | m0_ha_ut_link_usecase (void) |
|
static void | ha_ut_link_mt_thread (void *param) |
|
| M0_UT_THREADS_DEFINE (ha_ut_link_mt, &ha_ut_link_mt_thread) |
|
void | m0_ha_ut_link_multithreaded (void) |
|
static void | ha_ut_links_init (struct m0_ha_ut_rpc_ctx **rpc_ctx, struct m0_reqh_service **hl_service, int nr_links, struct ha_ut_link_ctx ***ctx, struct m0_ha_link ***hl, struct m0_uint128 *id1, struct m0_uint128 *id2, struct m0_uint128 *id, int *tag_even, bool start) |
|
static void | ha_ut_links_fini (struct m0_ha_ut_rpc_ctx *rpc_ctx, struct m0_reqh_service *hl_service, int nr_links, struct ha_ut_link_ctx **ctx, struct m0_ha_link **hl) |
|
static void | ha_ut_link_msg_transfer (struct m0_ha_link *hl1, struct m0_ha_link *hl2) |
|
void | m0_ha_ut_link_reconnect_simple (void) |
|
void | m0_ha_ut_link_reconnect_multiple (void) |
|
void | m0_ha_ut_lq (void) |
|
void | m0_ha_ut_lq_mark_delivered (void) |
|
void | m0_ha_ut_msg_queue (void) |
|
HA epoch module.
High-availability (HA) sub-system defines "an HA epoch" as a maximal interval in the system history through which no failures are agreed upon.
When a new failure is detected or previous failure eliminated, the process of developing a consensus about the change in failure state is initiated within the HA sub-system. This process, if successful, culminates in transition to a new epoch.
An epoch is identified by "an epoch number", which is a 64-bit integer. A later epoch has greater number.
Motr operations that depend on failures are tagged by epoch numbers. Typically, rpc items, sent as part of an operation, carry as a field the number of the epoch in which the operation was initiated. If receiver receives a message from an epoch different from the epoch known to the receiver, it has to handle it specially. Possible options include:
HA notifies the system about transition to the new epoch by broadcasting special item to all nodes. This item is always processed by moving its receivers to the item's epoch.
I. Processes and Services
There are 2 kinds of messages: received and sent. Each message is received or sent in context of m0_ha_link.
msg_is_delivered_cb() means that the message has been successfully delivered to the destination and it is not going to be resent if the destination restarts. msg_is_not_delivered_cb() is called if the message can't be delivered. It may be delivered already but there is no confirmation that it has been delivered.
Each message has a tag. The tag has uint64_t type and it's assigned internally when user tries to send a message (m0_halon_interface_send(), for example). Tag value is unique for all the messages sent or received over a single m0_ha_link. No other assumption about tag value should be used.
User is responsible for locking.
TODO bob_of in ha_link_rpc_wait_cb TODO handle rpc failures in incoming fom (for reply) TODO use m0_module in m0_ha_link TODO reconsider localities for incoming/outgoing foms TODO handle rpc error in HA_LINK_OUTGOING_STATE_CONNECTING state TODO m0_ha_link_cb_disconnecting() and m0_ha_link_cb_reused() - copy-paste