39 static const char local_conf_str[] =
"[35:\ 40 {0x74| ((^t|1:0), 1, (11, 22), ^o|1:23, ^v|1:24, 41212,\ 41 [3: \"param-0\", \"param-1\", \"param-2\"],\ 47 {0x70| ((^p|1:0), [1: ^o|1:23])},\ 48 {0x6e| ((^n|1:2), 16000, 2, 3, 2, [1: ^r|1:3])},\ 49 {0x72| ((^r|1:3), [1:3], 0, 0, 0, 0, \"addr-0\", [6: ^s|1:4,\ 55 {0x73| ((^s|1:4), @M0_CST_MDS, [3: \"addr-0\", \"addr-1\", \"addr-2\"], [0],\ 57 {0x73| ((^s|1:5), @M0_CST_IOS, [3: \"addr-0\", \"addr-1\", \"addr-2\"], [0],\ 58 [5: ^d|1:10, ^d|1:11, ^d|1:12, ^d|1:13, ^d|1:14])},\ 59 {0x73| ((^s|1:6), @M0_CST_CONFD, [3: \"addr-0\", \"addr-1\", \"addr-2\"],\ 61 {0x73| ((^s|1:7), @M0_CST_RMS, [3: \"addr-0\", \"addr-1\", \"addr-2\"], [0],\ 63 {0x73| ((^s|1:8), @M0_CST_HA, [3: \"addr-0\", \"addr-1\", \"addr-2\"], [0],\ 65 {0x73| ((^s|1:9), @M0_CST_IOS, [1: \"addr-3\"], [0], [0])},\ 66 {0x64| ((^d|1:10), 1, 4, 1, 4096, 596000000000, 3, 4, \"/dev/sdev0\")},\ 67 {0x64| ((^d|1:11), 2, 4, 1, 4096, 596000000000, 3, 4, \"/dev/sdev1\")},\ 68 {0x64| ((^d|1:12), 3, 7, 2, 8192, 320000000000, 2, 4, \"/dev/sdev2\")},\ 69 {0x64| ((^d|1:13), 4, 7, 2, 8192, 320000000000, 2, 4, \"/dev/sdev3\")},\ 70 {0x64| ((^d|1:14), 5, 7, 2, 8192, 320000000000, 2, 4, \"/dev/sdev4\")},\ 71 {0x53| ((^S|2:15), [1: ^a|1:15], [1: ^v|1:24])},\ 72 {0x61| ((^a|1:15), [1: ^e|1:16], [1: ^v|1:24])},\ 73 {0x65| ((^e|1:16), ^n|1:2, [1: ^c|1:17], [1: ^v|1:24])},\ 74 {0x63| ((^c|1:17), [5: ^k|1:18, ^k|1:19, ^k|1:20,\ 75 ^k|1:21, ^k|1:22], [1: ^v|1:24])},\ 76 {0x6b| ((^k|1:18), ^d|1:10, [1: ^v|1:24])},\ 77 {0x6b| ((^k|1:19), ^d|1:11, [1: ^v|1:24])},\ 78 {0x6b| ((^k|1:20), ^d|1:12, [1: ^v|1:24])},\ 79 {0x6b| ((^k|1:21), ^d|1:13, [1: ^v|1:24])},\ 80 {0x6b| ((^k|1:22), ^d|1:14, [1: ^v|1:24])},\ 81 {0x6f| ((^o|1:23), 0, [1: ^v|1:24])},\ 82 {0x76| ((^v|1:24), {0| (3, 1, 1, 5, [5: 0,0,0,0,1], [1: ^j|3:25])})},\ 83 {0x6a| ((^j|3:25), ^S|2:15, [1: ^j|1:25])},\ 84 {0x6a| ((^j|1:25), ^a|1:15, [1: ^j|1:26])},\ 85 {0x6a| ((^j|1:26), ^e|1:16, [1: ^j|1:27])},\ 86 {0x6a| ((^j|1:27), ^c|1:17, [5: ^j|1:28, ^j|1:29,\ 87 ^j|1:30, ^j|1:31, ^j|1:32])},\ 88 {0x6a| ((^j|1:28), ^k|1:18, [0])},\ 89 {0x6a| ((^j|1:29), ^k|1:19, [0])},\ 90 {0x6a| ((^j|1:30), ^k|1:20, [0])},\ 91 {0x6a| ((^j|1:31), ^k|1:21, [0])},\ 92 {0x6a| ((^j|1:32), ^k|1:22, [0])}]";
100 .pa_unit_size = 4096,
122 uint64_t *failed_domains);
124 uint64_t tol, uint64_t *failed_domains);
143 uint64_t children_cnt;
214 for (row = omega *
C; row < (omega + 1) *
C; ++row) {
266 uint64_t *children_nr;
293 for (row = omega *
C; row < (omega + 1) *
C; ++row) {
295 for (col = 0; col <
G; ++col) {
339 char *confstr =
NULL;
341 uint32_t failure_level = 0;
342 uint64_t max_failures = 1;
362 M0_CONF_ROOT_POOLS_FID,
363 M0_CONF_POOL_PVERS_FID);
375 if (
pv->pv_u.subtree.pvs_tolerance[
i] != 0) {
376 max_failures =
pv->pv_u.subtree.pvs_tolerance[
i];
386 pv->pv_u.subtree.pvs_tolerance[failure_level] = 0;
390 for (
i = 0;
i < max_failures; ++
i) {
401 ++
pv->pv_u.subtree.pvs_tolerance[failure_level];
404 memset(
pv->pv_u.subtree.pvs_tolerance, 0,
408 pv->pv_u.subtree.pvs_attr.pa_K = 0;
409 pv->pv_u.subtree.pvs_attr.pa_S = 0;
448 uint64_t *failed_domains;
454 failed_domains =
m0_alloc(tol *
sizeof failed_domains[0]);
465 for (row = omega *
C; row < (omega + 1) *
C; ++row) {
483 uint64_t tol, uint64_t *failed_domains)
507 failed_domains[
cnt] =
node->ftn_abs_idx;
515 uint64_t *failed_domains)
528 while (i < tgt->ta_obj) {
542 .
ts_name =
"failure_domains-ut",
const struct m0_conf_obj_type * m0_conf_obj_type(const struct m0_conf_obj *obj)
struct m0_conf_obj * cc_root
M0_INTERNAL int m0_fd_tile_build(const struct m0_conf_pver *pv, struct m0_pool_version *pool_ver, uint32_t *failure_level)
M0_INTERNAL void fd_ut_symm_tree_get(struct m0_fd_tree *tree, uint64_t *children_nr)
struct m0_pool_version * l_pver
struct m0_pool_version * pv
enum m0_trace_level level
uint32_t pv_fd_tol_vec[M0_CONF_PVER_HEIGHT]
M0_INTERNAL int m0_file_read(const char *path, char **out)
const struct m0_conf_obj_type M0_CONF_PVER_TYPE
M0_INTERNAL void fd_ut_children_populate(uint64_t *children, uint32_t depth)
static struct net_test_cmd_node * node
struct m0_layout_instance pi_base
struct m0_pool_version pool_ver
M0_INTERNAL int m0_confc_init(struct m0_confc *confc, struct m0_sm_group *sm_group, const char *confd_addr, struct m0_rpc_machine *rpc_mach, const char *local_conf)
M0_INTERNAL int m0_pdclust_perm_cache_build(struct m0_layout *layout, struct m0_pdclust_instance *pi)
M0_INTERNAL int m0_conf_diter_next_sync(struct m0_conf_diter *it, bool(*filter)(const struct m0_conf_obj *obj))
static struct m0_be_emap_cursor it
struct m0_conf_obj pv_obj
M0_INTERNAL void m0_confc_fini(struct m0_confc *confc)
M0_INTERNAL int m0_fd__tree_cursor_next(struct m0_fd__tree_cursor *cursor)
void test_fd_mapping(void)
#define M0_SRC_PATH(name)
M0_INTERNAL int m0_fd__tree_root_create(struct m0_fd_tree *tree, uint64_t root_children)
static void fd_tolerance_check(struct m0_pool_version *pv)
static void test_ft_mapping(void)
static uint64_t pool_width_calc(struct m0_fd_tree *tree)
static void test_fd_mapping_sanity(enum tree_attr ta)
uint64_t ft_child[M0_CONF_PVER_HEIGHT]
M0_INTERNAL void m0_fd_tgt_to_src(const struct m0_fd_tile *tile, const struct m0_pdclust_tgt_addr *tgt, struct m0_pdclust_src_addr *src)
M0_INTERNAL int m0_fd_tree_build(const struct m0_conf_pver *pv, struct m0_fd_tree *tree)
struct m0_ut_suite failure_domains_ut
struct m0_pdclust_src_addr src_new
M0_INTERNAL uint64_t m0_rnd(uint64_t max, uint64_t *seed)
struct m0_pdclust_attr pd_attr
struct m0_fd_tree pv_fd_tree
M0_INTERNAL int m0_conf_ut_ast_thread_fini(void)
static struct m0_confc * confc
m0_time_t m0_time_now(void)
M0_INTERNAL void m0_fd_tree_destroy(struct m0_fd_tree *tree)
struct m0_fd_tile pv_fd_tile
void * m0_alloc(size_t size)
static bool __filter_pv(const struct m0_conf_obj *obj)
struct m0_pdclust_instance pi
static void test_pv2fd_conv(void)
struct m0_sm_group m0_conf_ut_grp
M0_INTERNAL void m0_fd_bwd_map(struct m0_pdclust_instance *pi, const struct m0_pdclust_tgt_addr *tgt, struct m0_pdclust_src_addr *src)
#define M0_CONF_CAST(ptr, type)
#define m0_confc_open_sync(result, origin,...)
static uint32_t pool_width_count(uint64_t *children, uint32_t depth)
M0_INTERNAL int m0_conf_ut_ast_thread_init(void)
M0_INTERNAL struct m0_conf_obj * m0_conf_diter_result(const struct m0_conf_diter *it)
#define m0_conf_diter_init(iter, confc, origin,...)
struct m0_pdclust_tgt_addr tgt
static uint64_t real_child_cnt_get(uint64_t level)
#define M0_ALLOC_PTR(ptr)
M0_INTERNAL void m0_conf_diter_fini(struct m0_conf_diter *it)
M0_INTERNAL int m0_fd__perm_cache_build(struct m0_fd_tree *tree)
M0_INTERNAL int fd_ut_tree_level_populate(struct m0_fd_tree *tree, uint64_t max_children, uint16_t level, enum tree_attr ta)
static void failed_nodes_mark(struct m0_fd_tree *tree, uint32_t level, uint64_t tol, uint64_t *failed_domains)
M0_INTERNAL uint64_t fd_ut_random_cnt_get(uint64_t max_cnt)
M0_INTERNAL void m0_confc_close(struct m0_conf_obj *obj)
M0_INTERNAL void m0_pdclust_perm_cache_destroy(struct m0_layout *layout, struct m0_pdclust_instance *pi)
M0_INTERNAL void m0_fd_tile_destroy(struct m0_fd_tile *tile)
M0_INTERNAL void m0_fd__tile_populate(struct m0_fd_tile *tile)
M0_INTERNAL void m0_fd_src_to_tgt(const struct m0_fd_tile *tile, const struct m0_pdclust_src_addr *src, struct m0_pdclust_tgt_addr *tgt)
M0_INTERNAL int m0_fd__tile_init(struct m0_fd_tile *tile, const struct m0_pdclust_attr *la_attr, uint64_t *children, uint64_t depth)
M0_INTERNAL void m0_fd_fwd_map(struct m0_pdclust_instance *pi, const struct m0_pdclust_src_addr *src, struct m0_pdclust_tgt_addr *tgt)
static void fd_mapping_check(struct m0_pool_version *pv)
M0_INTERNAL int fd_ut_tree_init(struct m0_fd_tree *tree, uint64_t tree_depth)
static uint64_t pv2tree_level_conv(uint64_t level, uint64_t tree_depth)
static void tree_generate(struct m0_pool_version *pv, enum tree_attr ta)
struct m0_pdclust_src_addr src
M0_INTERNAL int m0_fd__tree_cursor_init(struct m0_fd__tree_cursor *cursor, const struct m0_fd_tree *tree, uint16_t depth)
static bool is_tgt_failed(struct m0_pool_version *pv, struct m0_pdclust_tgt_addr *tgt, uint64_t *failed_domains)
M0_INTERNAL struct m0_fd_tree_node ** m0_fd__tree_cursor_get(struct m0_fd__tree_cursor *cursor)
static uint32_t parity_group_size(struct m0_pdclust_attr *la_attr)