Motr
M0
|
#include "fid/fid.h"
#include "fid/fid_xc.h"
#include "lib/chan.h"
#include "lib/types.h"
#include "lib/buf.h"
#include "lib/buf_xc.h"
#include "lib/mutex.h"
#include "lib/tlist.h"
#include "lib/atomic.h"
#include "xcode/xcode_attr.h"
#include "ha/dispatcher.h"
Go to the source code of this file.
Data Structures | |
struct | m0_ha_note |
struct | m0_ha_nvec |
struct | m0_ha_state_single |
struct | m0_ha_msg_nvec_array |
struct | m0_ha_msg_nvec |
struct | m0_ha_note_handler |
Macros | |
#define | __MOTR___HA_NOTE_H__ |
#define | M0_NVEC_PRINT(nvec_, label, level) |
Enumerations | |
enum | m0_ha_obj_state { M0_NC_UNKNOWN, M0_NC_ONLINE, M0_NC_FAILED, M0_NC_TRANSIENT, M0_NC_REPAIR, M0_NC_REPAIRED, M0_NC_REBALANCE, M0_NC_DTM_RECOVERING, M0_NC_NR } |
enum | m0_ha_state_update_defaults { M0_HA_STATE_UPDATE_LIMIT = 1024 } |
enum | { M0_HA_NVEC_SET, M0_HA_NVEC_GET } |
Functions | |
struct m0_ha_note | M0_XCA_DOMAIN (rpc) |
M0_INTERNAL int | m0_ha_state_get (struct m0_ha_nvec *note, struct m0_chan *chan) |
M0_INTERNAL void | m0_ha_state_set (const struct m0_ha_nvec *note) |
M0_INTERNAL void | m0_ha_local_state_set (const struct m0_ha_nvec *nvec) |
M0_INTERNAL void | m0_ha_state_single_post (struct m0_ha_nvec *nvec) |
M0_INTERNAL void | m0_ha_state_accept (const struct m0_ha_nvec *note, bool ignore_same_state) |
M0_INTERNAL void | m0_conf_ha_callback (struct m0_conf_obj *obj) |
M0_INTERNAL void | m0_ha_msg_accept (const struct m0_ha_msg *msg, struct m0_ha_link *hl) |
M0_INTERNAL uint64_t | m0_ha_msg_nvec_send (const struct m0_ha_nvec *nvec, uint64_t id_of_get, bool ignore_same_state, int direction, struct m0_ha_link *hl) |
M0_INTERNAL int | m0_ha_note_handler_init (struct m0_ha_note_handler *hnh, struct m0_ha_dispatcher *hd) |
M0_INTERNAL void | m0_ha_note_handler_fini (struct m0_ha_note_handler *hnh) |
M0_INTERNAL uint64_t | m0_ha_note_handler_add (struct m0_ha_note_handler *hnh, struct m0_ha_nvec *nvec_req, struct m0_chan *chan) |
M0_INTERNAL void | m0_ha_note_handler_signal (struct m0_ha_note_handler *hnh, struct m0_ha_nvec *nvec_rep, uint64_t id) |
M0_INTERNAL const char * | m0_ha_state2str (enum m0_ha_obj_state state) |
Variables | |
struct m0_fid | no_id |
uint32_t | no_state |
int32_t | nv_nr |
struct m0_ha_note * | nv_note |
struct m0_ha_state_single | M0_XCA_DOMAIN |
struct m0_ha_note | hmna_arr [M0_HA_STATE_UPDATE_LIMIT] |
uint64_t | hmnv_type |
uint64_t | hmnv_id_of_get |
uint64_t | hmnv_ignore_same_state |
uint64_t | hmnv_nr |
struct m0_ha_msg_nvec_array | hmnv_arr |
struct m0_ha_note hmna_arr[M0_HA_STATE_UPDATE_LIMIT] |
struct m0_ha_msg_nvec_array hmnv_arr |
uint64_t hmnv_ignore_same_state |
Signal m0_conf_obj::co_ha_chan for changed HA states only?
If .hmnv_ignore_same_state == 0, then m0_conf_obj::co_ha_chan of every conf object in the .hmnv_arr will be signaled. Otherwise, only conf objects with changed HA state will be signaled.
|----------------—|----------------------—|--------------—| | Received HA state | .hmnv_ignore_same_state | Signal object's | | of a conf object | | .co_ha_chan? | | is different from | | | | its stored state | | | | (previously | | |
received)? | ||
---|---|---|
the same | 0 | yes |
the same | != 0 | no |
different | 0 | yes |
different | != 0 | yes |
----------------— | ----------------------— | --------------— |
NOTE: Hare monitors a subset (S
) of Motr conf objects. Whenever HA state of any of those objects changes, Hare creates an nvec with current HA states of all objects in S
and broadcasts this nvec to Motr processes. Upon receiving such nvec, Motr process compares it with previously stored one and signals only those conf objects, HA states of which differ.
In order for this to work, Hare MUST set .hmnv_ignore_same_state flag to 1.
Valid values: 0 or 1.
uint64_t hmnv_type |
struct m0_ha_note* nv_note |