|
static void | rconfc_start (struct m0_rconfc *rconfc) |
|
static void | rconfc_stop_internal (struct m0_rconfc *rconfc) |
|
static uint32_t | rconfc_state (const struct m0_rconfc *rconfc) |
|
static bool | rconfc_gate_check (struct m0_confc *confc) |
|
static int | rconfc_gate_skip (struct m0_confc *confc) |
|
static bool | rconfc_gate_drain (struct m0_clink *clink) |
|
static bool | ha_clink_cb (struct m0_clink *clink) |
|
static void | rconfc_read_lock_get (struct m0_rconfc *rconfc) |
|
static void | rconfc_read_lock_complete (struct m0_rm_incoming *in, int32_t rc) |
|
static void | rconfc_read_lock_conflict (struct m0_rm_incoming *in) |
|
| M0_TL_DESCR_DEFINE (rcnf_herd, "rconfc's working confc list", M0_INTERNAL, struct rconfc_link, rl_herd, rl_magic, M0_RCONFC_LINK_MAGIC, M0_RCONFC_HERD_HEAD_MAGIC) |
|
| M0_TL_DEFINE (rcnf_herd, M0_INTERNAL, struct rconfc_link) |
|
| M0_TL_DESCR_DEFINE (rcnf_active, "rconfc's active confc list", M0_INTERNAL, struct rconfc_link, rl_active, rl_magic, M0_RCONFC_LINK_MAGIC, M0_RCONFC_ACTIVE_HEAD_MAGIC) |
|
| M0_TL_DEFINE (rcnf_active, M0_INTERNAL, struct rconfc_link) |
|
static void | rconfc_load_ast_thread (struct rconfc_load_ctx *rx) |
|
static int | rconfc_load_ast_thread_init (struct rconfc_load_ctx *rx) |
|
static void | rconfc_load_ast_thread_fini (struct rconfc_load_ctx *rx) |
|
static void | rconfc_idle (struct m0_rconfc *rconfc) |
|
static void | rconfc_fail (struct m0_rconfc *rconfc, int rc) |
|
static void | rconfc_conf_load_fini (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
|
static void | rconfc_conf_full_load (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
|
static uint64_t | _confc_ver_read (const struct m0_confc *confc) |
|
static const char * | _confc_remote_addr_read (const struct m0_confc *confc) |
|
static int | _confc_cache_clean (struct m0_confc *confc) |
|
static int | _confc_cache_clean_lock (struct m0_confc *confc) |
|
static int | _confc_phony_init (struct m0_confc *confc) |
|
static void | _confc_phony_fini (struct m0_confc *phony) |
|
static int | _confc_phony_cache_append (struct m0_confc *confc, const struct m0_fid *fid) |
|
static void | _confc_phony_cache_remove (struct m0_confc *confc, const struct m0_fid *fid) |
|
static int | rlock_ctx_read_domain_init (struct rlock_ctx *rlx) |
|
static void | rlock_ctx_read_domain_fini (struct rlock_ctx *rlx) |
|
static struct m0_rconfc * | rlock_ctx_incoming_to_rconfc (struct m0_rm_incoming *in) |
|
static bool | rlock_ctx_is_online (struct rlock_ctx *rlx) |
|
static void | rlock_ctx_disconnect (struct rlock_ctx *rlx) |
|
static int | rlock_ctx_connect (struct rlock_ctx *rlx, const char *ep) |
|
static int | rlock_ctx_create (struct m0_rconfc *parent, struct m0_rpc_machine *rmach, struct rlock_ctx **out) |
|
static void | rlock_ctx_destroy (struct rlock_ctx *rlx) |
|
static enum m0_rm_owner_state | rlock_ctx_creditor_state (struct rlock_ctx *rlx) |
|
static int | rlock_ctx_creditor_setup (struct rlock_ctx *rlx, const char *ep) |
|
static void | rlock_ctx_creditor_unset (struct rlock_ctx *rlx) |
|
static void | rlock_ctx_owner_windup (struct rlock_ctx *rlx) |
|
static void | ver_accm_init (struct ver_accm *va, int total) |
|
static uint32_t | rconfc_confd_count (const char **confd_addr) |
|
static bool | rconfc_confd_addr_are_all_unique (const char **confd_addr) |
|
static bool | rconfc_is_locked (struct m0_rconfc *rconfc) |
|
static void | rconfc_read_lock_put (struct m0_rconfc *rconfc) |
|
static void | rconfc__ast_post (struct m0_rconfc *rconfc, void *datum, void(*cb)(struct m0_sm_group *, struct m0_sm_ast *)) |
|
static void | rconfc_link_ast_post (struct rconfc_link *lnk, void *datum, void(*cb)(struct m0_sm_group *, struct m0_sm_ast *)) |
|
static void | rconfc_ast_post (struct m0_rconfc *rconfc, void(*cb)(struct m0_sm_group *, struct m0_sm_ast *)) |
|
static void | rconfc_state_set (struct m0_rconfc *rconfc, int state) |
|
static void | _failure_ast_cb (struct m0_sm_group *grp M0_UNUSED, struct m0_sm_ast *ast) |
|
static void | rconfc_fail_ast (struct m0_rconfc *rconfc, int rc) |
|
M0_INTERNAL bool | m0_rconfc_reading_is_allowed (const struct m0_rconfc *rconfc) |
|
static bool | rconfc_quorum_is_reached (struct m0_rconfc *rconfc) |
|
static void | rconfc_active_all_unlink (struct m0_rconfc *rconfc) |
|
static void | rconfc_herd_link_subscribe (struct rconfc_link *lnk) |
|
static void | rconfc_link_fini_ast (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
|
static void | rconfc_herd_link_unsubscribe (struct rconfc_link *lnk) |
|
static struct m0_reqh * | rconfc_link2reqh (struct rconfc_link *lnk) |
|
static bool | rconfc_herd_link__on_death_cb (struct m0_clink *clink) |
|
static void | rconfc_herd_link_init (struct rconfc_link *lnk) |
|
M0_INTERNAL void | rconfc_herd_link_fini (struct rconfc_link *lnk) |
|
static void | rconfc_herd_ast (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
|
static bool | rconfc_herd_fini_cb (struct m0_clink *link) |
|
static void | rconfc_ha_update_ast (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
|
static bool | rconfc_ha_update_cb (struct m0_clink *link) |
|
static int | rconfc_herd_fini (struct m0_rconfc *rconfc) |
|
static void | rconfc_herd_link_destroy (struct rconfc_link *lnk) |
|
M0_INTERNAL void | rconfc_herd_link_cleanup (struct rconfc_link *lnk) |
|
static void | rconfc_herd_prune (struct m0_rconfc *rconfc) |
|
static int | rconfc_herd_destroy (struct m0_rconfc *rconfc) |
|
M0_INTERNAL struct rconfc_link * | rconfc_herd_find (struct m0_rconfc *rconfc, const char *addr) |
|
static int | rconfc_herd_update (struct m0_rconfc *rconfc, const char **confd_addr, struct m0_fid_arr *confd_fids) |
|
static void | rconfc_active_add (struct m0_rconfc *rconfc, struct rconfc_link *lnk) |
|
static void | rconfc_active_populate (struct m0_rconfc *rconfc) |
|
static int | rconfc_conductor_connect (struct m0_rconfc *rconfc, struct rconfc_link *lnk) |
|
static int | rconfc_conductor_iterate (struct m0_rconfc *rconfc) |
|
static void | rconfc_entrypoint_debug_print (struct m0_ha_entrypoint_rep *entrypoint) |
|
static int | rconfc_entrypoint_consume (struct m0_rconfc *rconfc) |
|
static int | rconfc_start_internal (struct m0_rconfc *rconfc) |
|
static void | rconfc_start_ast_cb (struct m0_sm_group *grp M0_UNUSED, struct m0_sm_ast *ast) |
|
static void | rconfc_read_lock_retry (struct m0_sm_group *grp M0_UNUSED, struct m0_sm_ast *ast) |
|
static void | rconfc_owner_creditor_reset (struct m0_sm_group *grp M0_UNUSED, struct m0_sm_ast *ast) |
|
static bool | rlock_owner_clink_cb (struct m0_clink *cl) |
|
static void | rconfc_creditor_death_handle (struct m0_rconfc *rconfc) |
|
static void | rconfc_conductor_disconnected (struct m0_rconfc *rconfc) |
|
static void | rconfc_conductor_disconnected_ast (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
|
static bool | rconfc_conductor_disconnect_cb (struct m0_clink *clink) |
|
static void | rconfc_conductor_drained (struct m0_rconfc *rconfc) |
|
static void | rconfc_conductor_drain (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
|
static bool | rconfc_unpinned_cb (struct m0_clink *link) |
|
static void | rlock_conflict_handle (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
|
static void | rconfc_rlock_windup (struct m0_rconfc *rconfc) |
|
static void | rconfc_stop_ast_cb (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
|
static bool | rconfc_quorum_is_possible (struct m0_rconfc *rconfc) |
|
static bool | rconfc_quorum_test (struct m0_rconfc *rconfc, struct m0_confc *confc) |
|
static int | rconfc_conductor_engage (struct m0_rconfc *rconfc) |
|
static void | rconfc_cctx_fini (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
|
static void | rconfc_herd_cctxs_fini (struct m0_rconfc *rconfc) |
|
static void | rconfc_version_elected (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
|
static bool | rconfc__cb_quorum_test (struct m0_clink *clink) |
|
static void | rconfc_version_elect (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
|
static int | rconfc_local_load (struct m0_rconfc *rconfc) |
|
M0_INTERNAL void | m0_rconfc_lock (struct m0_rconfc *rconfc) |
|
M0_INTERNAL void | m0_rconfc_unlock (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) |
|
M0_INTERNAL int | m0_rconfc_start (struct m0_rconfc *rconfc) |
|
M0_INTERNAL int | m0_rconfc_start_wait (struct m0_rconfc *rconfc, uint64_t timeout_ns) |
|
M0_INTERNAL void | m0_rconfc_stop (struct m0_rconfc *rconfc) |
|
M0_INTERNAL void | m0_rconfc_stop_sync (struct m0_rconfc *rconfc) |
|
M0_INTERNAL void | m0_rconfc_fini (struct m0_rconfc *rconfc) |
|
M0_INTERNAL uint64_t | m0_rconfc_ver_max_read (struct m0_rconfc *rconfc) |
|
M0_INTERNAL void | m0_rconfc_fatal_cb_set (struct m0_rconfc *rconfc, m0_rconfc_cb_t cb) |
|
M0_INTERNAL int | m0_rconfc_confd_endpoints (struct m0_rconfc *rconfc, const char ***eps) |
|
M0_INTERNAL int | m0_rconfc_rm_endpoint (struct m0_rconfc *rconfc, char **ep) |
|
M0_INTERNAL void | m0_rconfc_rm_fid (struct m0_rconfc *rconfc, struct m0_fid *out) |
|
M0_INTERNAL bool | m0_rconfc_is_preloaded (struct m0_rconfc *rconfc) |
|
static int rconfc_conductor_iterate |
( |
struct m0_rconfc * |
rconfc | ) |
|
|
static |
Iterates through active list entries and tries to connect next confd address. Finishes with either connection succeeded or list exhausted.
The intended effect is that all spare confc items are going to be marked CONFC_IDLE with the following exceptions:
- the newly connected item is marked CONFC_OPEN
- the previously connected item, i.e. the one which failure led to the iteration, is marked CONFC_FAILED
- every item found non-responsive during the iteration is marked CONFC_FAILED
- Note
- All CONFC_FAILED items are going to be re-set to CONFC_IDLE, and due to this, re-tried when next iteration starts.
- Note
- The iteration procedure above performs synchronous connection in rconfc_conductor_connect() with every remote confd in rcnf_active list until the connection succeeds. Every failed case is going to take some time until CONDUCTOR_TIMEOUT_DEFAULT expires. Theoretically this may keep rconfc AST thread busy for some time while conductor is still trying to get to connected state.
It is worth mentioning that the iteration is done with empty conductor's cache, so there are no consumers trying to access conf objects from other threads while rconfc remains locked. This may diminish the influence of possible blocking effect of the synchronous connection approach.
Nevertheless, this synchronism may be a subject for future rconfc redesign in case any negative effects get revealed.
New design is to partition the rconfc_conductor_iterate() logic. The first part preceding the while() above is to prepare iteration and start iterator FOM that is to re-implement the logic of the while() block. rconfc_version_elected() is going to be affected as well. New design is going to bring extra complexity into existent rconfc design.
However, the redesign must take into consideration the fact that rconfc_gate_skip() re-uses the rconfc_conductor_iterate() logic and currently expects it to be performed exactly synchronous way. So, the redesign must be done not only in regard to post-election phase (rconfc_version_elected() partitioning), but asynchronous confc gating must be designed as well.
Again, it is worth mentioning that with current logic of full conf loading before rconfc announces the conf ready, the confd skipping may occur only during conf loading, when it is guaranteed to have no conf consumers accessing objects in cache at the time.
Definition at line 1799 of file rconfc.c.
- Todo:
- The dead confd fid is going to be removed from phony cache, and the link object to be finalised in rconfc_link_fom_fini(). Therefore, no way remains to listen for the confd state changes in future. You may be tempted by an idea of reviving the link in case the confd is announced M0_NC_ONLINE later, but consider the following analysis:
Merits:
The only merit of getting the link online is this may bring an additional active list entry into the effect, in case the revived confd runs version that was elected previously.
The merit is diminished by the fact that rconfc performs full conf load every time it obtains read lock, so using an alternative active link may be needed only during the conf load, and never happens after that until the moment of next version reelection.
Demerits:
a) The phony object must remain cached, and the herd link object must remain in the list during all the rconfc life.
b) Herd link revival is not an instant action. It requires the confc to connect, and invoke conf reading in case of success. If reading succeeds, the conf version must be qualified, and in case it matches with the currently elected one, the entry must be finally added to active list. The entire routine seems to require an additional state machine to be added to herd link. The machine must be reconciled with rconfc state machine. This is ultimately to additionally complicate the existing rconfc state machine, and do that rather seriously. Otherwise, controlling rconfc state while having the revival in background may result in unpredictable races.
c) There may be several concurrent M0_NC_ONLINE events, or state jitters, that in combination with async processing make the whole logic be really non-trivial compared to on-death processing.
So the merit of having an additional active entry is going to be achieved at the cost of over-complicating the existing rconfc design and an impact on rconfc code maintainability and extensibility. At the same time a simple version reelection may achieve the same result at sufficiently lower cost, as all the logic of entrypoint re-querying is already implemented in the context of MOTR-2113,2150.
Definition at line 1321 of file rconfc.c.