Motr  M0
note.h File Reference
#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"
Include dependency graph for note.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_notenv_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
 

Macro Definition Documentation

◆ __MOTR___HA_NOTE_H__

#define __MOTR___HA_NOTE_H__

Definition at line 26 of file note.h.

Variable Documentation

◆ hmna_arr

Definition at line 324 of file note.h.

◆ hmnv_arr

struct m0_ha_msg_nvec_array hmnv_arr

Definition at line 364 of file note.h.

◆ hmnv_id_of_get

uint64_t hmnv_id_of_get

Definition at line 326 of file note.h.

◆ hmnv_ignore_same_state

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.

Definition at line 362 of file note.h.

◆ hmnv_nr

uint64_t hmnv_nr

Definition at line 363 of file note.h.

◆ hmnv_type

uint64_t hmnv_type

M0_HA_NVEC_SET for note_set, M0_HA_NVEC_GET for note_get

Definition at line 325 of file note.h.

◆ no_id

struct m0_fid no_id

Object identifier.

Definition at line 325 of file note.h.

◆ no_state

uint32_t no_state

State, from enum m0_ha_obj_state.

Definition at line 327 of file note.h.

◆ nv_note

struct m0_ha_note* nv_note

Definition at line 332 of file note.h.

◆ nv_nr

int32_t nv_nr
Note
Since this field is used for returning error code to note interface users
See also
m0_conf_ha_state_update(), changing this to int32_t. Anyway nvec will not request status for 2^16 object because of RPC mesg size constrains.

Definition at line 331 of file note.h.