Motr
M0
|
Detailed Functional Specification. More...
Data Structures | |
struct | rconfc_load_ctx |
struct | m0_rconfc |
Typedefs | |
typedef void(* | m0_rconfc_cb_t) (struct m0_rconfc *rconfc) |
Detailed Functional Specification.
enum m0_rconfc_state |
M0_INTERNAL int m0_rconfc_confd_endpoints | ( | struct m0_rconfc * | rconfc, |
const char *** | eps | ||
) |
Allocates and fills eps with confd endpoints from m0_rconfc::rc_herd list. Returns number of endpoints or -ENOMEM if memory allocation was failed during duplication of an endpoint.
Definition at line 3081 of file rconfc.c.
M0_INTERNAL void m0_rconfc_fatal_cb_set | ( | struct m0_rconfc * | rconfc, |
m0_rconfc_cb_t | cb | ||
) |
M0_INTERNAL void m0_rconfc_fini | ( | struct m0_rconfc * | rconfc | ) |
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 | ||
) |
Initialise redundant configuration client instance.
If initialisation fails, then finalisation is done internally. No explicit m0_rconfc_fini() is needed.
rconfc | - rconfc instance |
profile | - makes sense for clients only, otherwise - &M0_FID0. |
sm_group | - state machine group to be used with confc. Opening conf objects later in context of this SM group is prohibited, so providing locality SM group is a bad choice. Use locality0 (m0_locality0_get()) or some dedicated SM group. |
rmach | - RPC machine to be used to communicate with confd |
exp_cb | - callback, a "configuration just expired" event |
ready_cb | - rconfc is ready for reading configuration |
Definition at line 2860 of file rconfc.c.
M0_INTERNAL bool m0_rconfc_is_preloaded | ( | struct m0_rconfc * | rconfc | ) |
When running 'pre-loaded' mode no communication with a herd of confd instances, reaching quorum, getting read lock, blocking read context, etc. is supposed on such rconfc instance. In this case it just shells the pre-filled rc_confc while having all event mechanisms disabled. In this case rconfc remains to be in M0_RCS_INIT state.
Definition at line 3135 of file rconfc.c.
M0_INTERNAL void m0_rconfc_lock | ( | struct m0_rconfc * | rconfc | ) |
M0_INTERNAL bool m0_rconfc_reading_is_allowed | ( | const struct m0_rconfc * | rconfc | ) |
M0_INTERNAL int m0_rconfc_rm_endpoint | ( | struct m0_rconfc * | rconfc, |
char ** | ep | ||
) |
Allocates and fills ep with RM endpoint from m0_rconfc::rc_rlock_ctx::rlc_rm_addr. Returns 0 if success or -ENOMEM if memory allocation was failed during duplication of the endpoint.
Definition at line 3106 of file rconfc.c.
M0_INTERNAL int m0_rconfc_start | ( | struct m0_rconfc * | rconfc | ) |
Rconfc starts with obtaining all necessary information (cluster "entry point") from HA service.
Rconfc continues with election, where allocated confc instances poll corresponding confd for configuration version number they currently run. At the same time confd availability is tested.
Election ends when some version has a quorum. At the same time the active list is populated with rconfc_link instances which confc points to confd of the newly elected version.
Function is asynchronous, user can wait on rconfc->rc_sm.sm_chan until rconfc->rc_sm.sm_state in (M0_RCS_IDLE, M0_RCS_FAILURE). M0_RCS_FAILURE state means that start failed, return code can be obtained from rconfc->rc_sm.sm_rc.
When m0_rconfc::rc_local_conf is not NULL during start, m0_rconfc::rc_confc is pre-loaded from the local configuration string. Such rconfc instance does not participate in standard rconfc activity like holding read lock, version election etc., and being pre-loaded it can only be stopped and finalised.
Definition at line 2928 of file rconfc.c.
|
inlinestatic |
M0_INTERNAL int m0_rconfc_start_wait | ( | struct m0_rconfc * | rconfc, |
uint64_t | timeout_ns | ||
) |
Synchronous version of m0_rconfc_start() with limited deadline. Use M0_TIME_NEVER value to indicate infinite waiting.
Definition at line 2942 of file rconfc.c.
M0_INTERNAL void m0_rconfc_stop | ( | struct m0_rconfc * | rconfc | ) |
Finalises dedicated m0_rconfc::rc_confc instance and puts all the acquired resources back.
Function is asynchronous, user should wait on rconfc->rc_sm.sm_chan until rconfc->rc_sm.sm_state is M0_RCS_FINAL.
Definition at line 2978 of file rconfc.c.
M0_INTERNAL void m0_rconfc_stop_sync | ( | struct m0_rconfc * | rconfc | ) |
Synchronous version of m0_rconfc_stop().
Definition at line 2995 of file rconfc.c.
M0_INTERNAL void m0_rconfc_unlock | ( | struct m0_rconfc * | rconfc | ) |
M0_INTERNAL uint64_t m0_rconfc_ver_max_read | ( | struct m0_rconfc * | rconfc | ) |
Maximum version number the herd confc elements gathered from their confd peers.
Definition at line 3052 of file rconfc.c.