Motr  M0
m0_rconfc Struct Reference

#include <rconfc.h>

Collaboration diagram for m0_rconfc:
Collaboration graph

Data Fields

struct m0_confc rc_confc
 
struct m0_sm rc_sm
 
uint64_t rc_ver
 
uint32_t rc_quorum
 
m0_rconfc_cb_t rc_expired_cb
 
m0_rconfc_cb_t rc_ready_cb
 
m0_rconfc_cb_t rc_fatal_cb
 
struct m0_rpc_machinerc_rmach
 
struct m0_confc_gate_ops rc_gops
 
struct m0_sm_ast rc_ast
 
int rc_datum
 
struct m0_sm_ast rc_stop_ast
 
struct m0_sm_ast rc_cctx_fini_ast
 
struct m0_tl rc_herd
 
struct m0_tl rc_active
 
struct m0_clink rc_unpinned_cl
 
struct m0_clink rc_ha_entrypoint_cl
 
struct m0_clink rc_herd_cl
 
struct m0_clink rc_ha_update_cl
 
struct m0_ha_nvec rc_nvec
 
void * rc_qctx
 
void * rc_rlock_ctx
 
bool rc_stopping
 
bool rc_rlock_conflict
 
struct m0_confc rc_phony
 
char * rc_local_conf
 
struct m0_fid rc_profile
 
struct rconfc_load_ctx rc_rx
 
struct m0_sm_ast rc_load_ast
 
struct m0_sm_ast rc_load_fini_ast
 
struct m0_mutex rc_herd_lock
 
struct m0_chan rc_herd_chan
 
struct m0_clink rc_conductor_clink
 
struct m0_ha_entrypoint_rep rc_ha_entrypoint_rep
 
uint32_t rc_ha_entrypoint_retries
 
uint32_t rc_sm_state_on_abort
 
bool rc_quorum_decision_is_made
 

Detailed Description

Redundant configuration client.

Definition at line 220 of file rconfc.h.

Field Documentation

◆ rc_active

struct m0_tl rc_active

A list of confd servers running the elected version.

Definition at line 335 of file rconfc.h.

◆ rc_ast

struct m0_sm_ast rc_ast

AST to run functions in context of rconfc sm group.

Definition at line 325 of file rconfc.h.

◆ rc_cctx_fini_ast

struct m0_sm_ast rc_cctx_fini_ast

AST to be posted for cctx_fini.

Definition at line 331 of file rconfc.h.

◆ rc_conductor_clink

struct m0_clink rc_conductor_clink

Clink for asynchronous conductor connection/disconnection.

Definition at line 418 of file rconfc.h.

◆ rc_confc

struct m0_confc rc_confc

A dedicated confc instance initialised during m0_rconfc_start() in case the read lock is successfully acquired. Initially connected to a confd of the elected version, an element of m0_rconfc::rc_active list. Later, it may be reconnected on the fly to another confd server of the same version in case previous confd communication failed, or version re-election occurred.

Consumer is expected to use m0_rconfc::rc_confc instance for reading configuration data done any standard way in accordance with m0_confc specification. However, any explicit initialisation and finalisation of the instance must be avoided, as m0_rconfc is fully responsible for that part.

Definition at line 235 of file rconfc.h.

◆ rc_datum

int rc_datum

Additional data to be used inside AST (i.e. failure error code).

Definition at line 327 of file rconfc.h.

◆ rc_expired_cb

m0_rconfc_cb_t rc_expired_cb

Rconfc expiration callback. Installed during m0_rconfc_init(), but is allowed to be re-set later if required, on a locked rconfc instance.

The callback is executed being under rconfc lock.

Rconfc expiration callback is called when rconfc election happens. The callee side must close all configuration objects currently held and invalidate locally stored configuration data copies if any.

Note
No configuration reading is granted during the call because of rconfc locked state. Therefore, configuration reader should schedule reading for some time in future. The callback will also be called when reaching quorum is not possible. In this case rconfc->rc_ver == M0_CONF_VER_UNKNOWN.

Definition at line 278 of file rconfc.h.

◆ rc_fatal_cb

m0_rconfc_cb_t rc_fatal_cb

Rconfc callback called when M0_RCS_FAILURE state reached. Initially unset. Allowed to be installed after start if required, on a locked rconfc instance.

Note
Do not set m0_rconfc::rc_fatal_cb directly, use m0_rconfc_fatal_cb_set() instead.

Rconfc is expected to start without the callback set up. This lets us distinguish a failure during motr setup from a failure at runtime, and handle those appropriately.

Note
Rconfc fatal callback is called when m0_rconfc::rc_sm is switched to M0_RCS_FAILURE. This makes impossible to read configuration from m0_rconfc::rc_confc::cc_cache during the callback execution. Besides, the cache starts to be drained right before the call, so no part of the cache is guaranteed to remain available after call completion.

Definition at line 315 of file rconfc.h.

◆ rc_gops

struct m0_confc_gate_ops rc_gops

Gating operations. Intended to control m0_rconfc::rc_confc ability to perform configuration reading operations.

Definition at line 323 of file rconfc.h.

◆ rc_ha_entrypoint_cl

struct m0_clink rc_ha_entrypoint_cl

Clink to track ha entrypoint state changes

Definition at line 339 of file rconfc.h.

◆ rc_ha_entrypoint_rep

struct m0_ha_entrypoint_rep rc_ha_entrypoint_rep

HA ENTRYPOINT reply local copy

Definition at line 420 of file rconfc.h.

◆ rc_ha_entrypoint_retries

uint32_t rc_ha_entrypoint_retries

Retries made to obtain ENTRYPOINT information sufficient for successfull rconfc start.

Definition at line 425 of file rconfc.h.

◆ rc_ha_update_cl

struct m0_clink rc_ha_update_cl

Clink to track the finish of m0_conf_confc_ha_update_async() on phony confc.

Definition at line 346 of file rconfc.h.

◆ rc_herd

struct m0_tl rc_herd

A list of confc instances used during election.

Definition at line 333 of file rconfc.h.

◆ rc_herd_chan

struct m0_chan rc_herd_chan

The channel is to announce herd link finalisation completion. Herd must be safe to finalise only when having no links which FOMs are already queued for finalisation.

Definition at line 416 of file rconfc.h.

◆ rc_herd_cl

struct m0_clink rc_herd_cl

Clink to track confc context state transition on rconfc_herd_fini

Definition at line 341 of file rconfc.h.

◆ rc_herd_lock

struct m0_mutex rc_herd_lock

The mutex is to protect m0_rconfc::rc_herd_chan.

As well, rconfc_link::rl_fom_queued value is accessed by rconfc code strictly under the lock.

Definition at line 410 of file rconfc.h.

◆ rc_load_ast

struct m0_sm_ast rc_load_ast

AST used for full conf load during rconfc life

Definition at line 401 of file rconfc.h.

◆ rc_load_fini_ast

struct m0_sm_ast rc_load_fini_ast

AST used for full conf load finalisation

Definition at line 403 of file rconfc.h.

◆ rc_local_conf

char* rc_local_conf

Local configuration database string to be passed to rc_confc during its initialisation. Initially NULL-ed it can be set prior to running m0_rconfc_start(). Being set it indicates that rconfc is to be running mode compatible with confd, i.e. having cache pre-loaded.

See also
m0_rconfc_is_preloaded()
Note
rconfc takes care of freeing this string with m0_free() during finalisation.

Definition at line 390 of file rconfc.h.

◆ rc_nvec

struct m0_ha_nvec rc_nvec

nvec for m0_conf_confc_ha_update_async().

Definition at line 348 of file rconfc.h.

◆ rc_phony

struct m0_confc rc_phony

Confc instance artificially filled with objects having fids of current confd and top-level RM services got from HA. Artificial nature is because of filling its cache non-standard way at the time when conventional configuration reading is impossible due to required conf version number remaining unknown until election procedure is done.

This instance is added to HA clients list and serves HA notifications about remote confd and RM service deaths. The intention is to automatically keep herd list and top-level RM endpoint address up to date during the entire rconfc instance life cycle.

Attention
Never use this confc for real configuration reading. No RPC communication is possible with the instance due to the way of its initialisation.

Definition at line 378 of file rconfc.h.

◆ rc_profile

struct m0_fid rc_profile

Profile FID rconfc to work on. M0_FID0 if not present.

Definition at line 392 of file rconfc.h.

◆ rc_qctx

void* rc_qctx

Quorum calculation context.

Definition at line 351 of file rconfc.h.

◆ rc_quorum

uint32_t rc_quorum

The minimum number of confc-s that must have the same version of configuration in order for this version to be elected. Read-only.

Definition at line 258 of file rconfc.h.

◆ rc_quorum_decision_is_made

bool rc_quorum_decision_is_made

quorum is computed once and will de done again after rm revoke.

Definition at line 435 of file rconfc.h.

◆ rc_ready_cb

m0_rconfc_cb_t rc_ready_cb

Rconfc idle callback. Initially unset. Allowed to be installed later if required, on a locked rconfc instance.

The callback is executed being under rconfc lock.

Rconfc ready callback is called when m0_rconfc::rc_sm is switched to M0_RCS_IDLE state. Callback indicates that configuration is available for reading using m0_rconfc::rc_confc.

Note
No configuration reading is possible during the callback execution due to the locked state, and the reading should be scheduled for some time in future.

Definition at line 294 of file rconfc.h.

◆ rc_rlock_conflict

bool rc_rlock_conflict

Indicates whether read lock conflict was observed and should be processed once rconfc is idle.

Definition at line 360 of file rconfc.h.

◆ rc_rlock_ctx

void* rc_rlock_ctx

Read lock context.

Definition at line 353 of file rconfc.h.

◆ rc_rmach

struct m0_rpc_machine* rc_rmach

RPC machine the rconfc to work on.

Definition at line 318 of file rconfc.h.

◆ rc_rx

struct rconfc_load_ctx rc_rx

Context for full conf loading.

Note
Currently many parts of Motr rely on full configuration availability at operation time.

Definition at line 399 of file rconfc.h.

◆ rc_sm

struct m0_sm rc_sm

Rconfc state machine.

Note
rc_ha_update_cl links to the rc_sm.sm_chan which is used as argument for the m0_conf_confc_ha_update_async() call. It is convenient as we don't need additional channel and mutex structures just to get the notification about confc_ha_update completion. The drawback of this approach is that the threads waiting for the SM state change (like at m0_rconfc_start_wait()) will be awaken needlessly. But this seems to be harmless.

Definition at line 247 of file rconfc.h.

◆ rc_sm_state_on_abort

uint32_t rc_sm_state_on_abort

The state, which m0_rconfc::rc_sm was in prior to entering M0_RCS_FAILURE state. Rconfc start may fail due to external causes unrelated to rconfc internal workings, e.g. start timeout expired.

Definition at line 431 of file rconfc.h.

◆ rc_stop_ast

struct m0_sm_ast rc_stop_ast

AST to be posted when user requests rconfc to stop.

Definition at line 329 of file rconfc.h.

◆ rc_stopping

bool rc_stopping

Indicates whether user requests rconfc stopping.

Definition at line 355 of file rconfc.h.

◆ rc_unpinned_cl

struct m0_clink rc_unpinned_cl

Clink to track unpinned conf objects during confc cache drop

Definition at line 337 of file rconfc.h.

◆ rc_ver

uint64_t rc_ver

Version number the quorum was reached for. Read-only. Value M0_CONF_VER_UNKNOWN indicates that the latest version election failed or never was carried out.

Definition at line 253 of file rconfc.h.


The documentation for this struct was generated from the following file: