30 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CAS 43 #include "cas/cas_xc.h" 48 #define IFID(x, y) M0_FID_TINIT('i', (x), (y)) 49 #define TFID(x, y) M0_FID_TINIT('T', (x), (y)) 89 at_buf->
u.ab_buf =
buf;
109 dst->ab_type =
src->ab_type;
114 static void reqh_init(
bool mkfs,
bool use_small_credits)
125 .rhia_mdstore = (
void *)1,
137 static void _init(
bool mkfs,
bool use_small_credits)
373 struct m0_tlink *link = &
fom->fo_tx.tx_betx.t_engine_linkage;
391 .cg_rec = { .cr_rec = rec }
396 while (rec[
op.cg_rec.cr_nr].
cr_rc != ~0ULL)
399 fs.fs_fop.f_item.ri_rmachine = (
void *)1;
442 for (
i = 0;
i < meta_recs_num;
i++) {
451 for (
i = 0;
i < meta_recs_num;
i++)
477 { .cr_key = at_buf },
478 { .cr_rc = ~0ULL } });
565 { .e_start = 5, .e_end = 7 },
566 { .e_start = 9, .e_end = 11 },
596 { .e_start = 5, .e_end = 7 },
597 { .e_start = 9, .e_end = 11 },
624 { .e_start = 5, .e_end = 7 },
625 { .e_start = 9, .e_end = 11 },
728 { .cid = cid, .rc = 1 } },
749 { .cid = cid, .rc = 2 } },
771 { .cid = cid, .rc = 0 } },
788 { .cid = cid, .rc = 1 } },
808 { .cid = cid, .rc = 4 } },
832 { .cid = cid , .rc = 5 } },
877 for (
i = 0;
i < 50; ++
i) {
880 memset(mrecs, 0,
sizeof(mrecs));
886 for (j = 0; j < K; ++j) {
914 enum {
M = 16*1024 };
924 for (
i = 0;
i < 200; ++
i) {
925 for (j = 0; j < 10; ++j) {
943 uint64_t
key, uint64_t
val, uint64_t
rc)
949 { .cr_key.u.ab_buf =
key != 0 ?
958 { .cr_rc = ~0ULL } });
962 uint64_t
key, uint64_t
val)
999 == sizeof (uint64_t));
1098 #define CB(x) m0_byteorder_cpu_to_be64(x) 1099 #define BC(x) m0_byteorder_be64_to_cpu(x) 1212 for (j =
i, k = 0; j <
INSERTS; j += 2, ++k) {
1216 buf = &
r->cr_val.u.ab_buf;
1220 buf = &
r->cr_key.u.ab_buf;
1234 uint64_t
seed = time(
NULL) * (idx + 6);
1239 for (
i = 0;
i < 20; ++
i) {
1741 { .cid = cid, .rc = 1 } },
1753 == sizeof (uint64_t));
1796 { .cid = nonce1 } },
1804 { .cid = nonce1 } },
1812 { .cid = nonce1 } },
1820 { .cid = nonce1 } },
1828 { .cid = nonce1 } },
1836 { .cid = nonce1 } },
1882 { .cid = nonce1 } },
1906 { .cid = nonce1 } },
1917 { .cid = nonce1 } },
1961 .ts_owners =
"Nikita",
1967 {
"re-init", &
reinit,
"Egor" },
1968 {
"re-start", &
restart,
"Nikita" },
1972 {
"create", &
create,
"Nikita" },
1976 {
"recreate", &
recreate,
"Nikita" },
1985 {
"insert", &
insert,
"Nikita" },
1990 {
"insert-2", &
insert_2,
"Nikita" },
1991 {
"delete-2", &
delete_2,
"Nikita" },
1992 {
"lookup-N", &
lookup_N,
"Nikita" },
1994 {
"cur-N", &
cur_N,
"Nikita" },
1995 {
"meta-mt", &
meta_mt,
"Nikita" },
2021 #undef M0_TRACE_SUBSYSTEM
M0_EXTERN struct m0_reqh_service_type m0_fdmi_service_type
static void lookup_none(void)
struct m0_rpc_at_buf cr_val
static void multi_insert(void)
#define M0_ALLOC_ARR(arr, nr)
M0_INTERNAL int m0_reqh_service_start(struct m0_reqh_service *service)
M0_INTERNAL int m0_be_ut_backend_init_cfg(struct m0_be_ut_backend *ut_be, const struct m0_be_domain_cfg *cfg, bool mkfs)
M0_INTERNAL void m0_reqh_service_stop(struct m0_reqh_service *service)
int m0_thread_join(struct m0_thread *q)
static void recreate(void)
#define M0_REQH_INIT(reqh,...)
static void rep_clear(void)
static struct m0_be_seg * seg0
static void create_delete(void)
M0_INTERNAL void m0_fop_init(struct m0_fop *fop, struct m0_fop_type *fopt, void *data, void(*fop_release)(struct m0_ref *))
M0_INTERNAL int m0_reqh_fop_handle(struct m0_reqh *reqh, struct m0_fop *fop)
M0_INTERNAL void m0_rpc_at_init(struct m0_rpc_at_buf *ab)
M0_INTERNAL void m0_reqh_service_prepare_to_stop(struct m0_reqh_service *service)
static struct m0_cas_rep rep
static void meta_cur_0(void)
M0_INTERNAL bool m0_rpc_at_is_set(const struct m0_rpc_at_buf *ab)
#define M0_FID_INIT(container, key)
static void create_insert_drop()
static void cb_done(struct m0_fom *fom)
static void create_lookup(void)
static void init_fini(void)
static bool rep_check(int recno, uint64_t rc, int key, int val)
M0_INTERNAL const struct m0_fid m0_cas_meta_fid
M0_INTERNAL void m0_cas__ut_svc_be_set(struct m0_reqh_service *svc, struct m0_be_domain *dom)
struct m0_dix_layout ci_layout
int const char const void * value
M0_INTERNAL struct m0_be_seg * m0_be_domain_seg0_get(struct m0_be_domain *dom)
M0_INTERNAL const struct m0_fid_type m0_cas_index_fid_type
static void reqh_init(bool mkfs, bool use_small_credits)
void * m0_fop_data(const struct m0_fop *fop)
struct m0_cas_recv cgr_rep
#define M0_THREAD_INIT(thread, TYPE, init, func, arg, namefmt,...)
static void empty_value(void)
static void create_create(void)
static void insert_delete(void)
static void multi_create_drop(void)
struct m0_be_tx_credit bec_tx_size_max
static void lookup_restart(void)
static void meta_cur_1(void)
static void insert_fail(void)
M0_EXTERN struct m0_reqh_service_type m0_cas_service_type
struct m0_rpc_at_buf cr_val
M0_INTERNAL void m0_cas_module_fini(void)
#define M0_BE_TX_CREDIT(nr, size)
static void insert_odd(struct m0_fid *index)
static void meta_cur_empty(void)
struct m0_cas_rec * cr_rec
struct m0_reqh * bec_reqh
static void lookup_fail(void)
struct m0_rpc_at_buf cr_key
static void init_cgc_fail_fini(void)
static void meta_lookup_Nnone(void)
static void meta_insert_fail(void)
void m0_be_ut_backend_cfg_default(struct m0_be_domain_cfg *cfg)
M0_INTERNAL void m0_ref_put(struct m0_ref *ref)
static void cur_fail(void)
static void cctg_create_delete(void)
static void meta_invalid(void)
#define M0_FID_TINIT(type, container, key)
#define M0_AMB(obj, ptr, field)
M0_INTERNAL void m0_fi_disable(const char *fp_func, const char *fp_tag)
static struct m0_reqh reqh
static void multi_values_delete(struct record *recs, int recs_count)
struct m0_semaphore fs_end
static void m0_fi_enable(const char *func, const char *tag)
static struct m0_reqh_service * cas
static void meta_mt_thread(int idx)
static void delete_fail(void)
M0_INTERNAL void m0_reqh_service_fini(struct m0_reqh_service *service)
static struct m0_thread t[8]
static void multi_insert_fail(void)
struct m0_tl rh_rpc_machines
static void meta_random(void)
void m0_thread_fini(struct m0_thread *q)
static int cid_enc(struct m0_cas_id *cid, struct m0_rpc_at_buf *at_buf)
M0_INTERNAL int m0_dix_ldesc_init(struct m0_dix_ldesc *ld, struct m0_ext *range, m0_bcount_t range_nr, enum m0_dix_hash_fnc_type htype, struct m0_fid *pver)
M0_INTERNAL struct m0_fop_type cas_get_fopt
M0_INTERNAL int m0_xcode_obj_enc_to_buf(struct m0_xcode_obj *obj, void **buf, m0_bcount_t *len)
static void cctg_create_lookup(void)
static void index_op(struct m0_fop_type *ft, struct m0_fid *index, uint64_t key, uint64_t val)
M0_INTERNAL int m0_semaphore_init(struct m0_semaphore *semaphore, unsigned value)
static void multi_delete_fail(void)
static void cb_fini(struct m0_fom *fom)
static void multi_lookup_fail(void)
M0_INTERNAL struct m0_fop_type cas_cur_fopt
M0_INTERNAL int m0_reqh_service_allocate(struct m0_reqh_service **out, const struct m0_reqh_service_type *stype, struct m0_reqh_context *rctx)
static void init_fail(void)
union m0_rpc_at_buf::@447 u
M0_INTERNAL const struct m0_fid m0_cas_dead_index_fid
static int at_inline_fill(struct m0_rpc_at_buf *dst, struct m0_rpc_at_buf *src)
M0_INTERNAL void m0_reqh_service_init(struct m0_reqh_service *service, struct m0_reqh *reqh, const struct m0_fid *fid)
union m0_dix_layout::@145 u
static void meta_cur_none(void)
M0_INTERNAL int m0_buf_copy(struct m0_buf *dest, const struct m0_buf *src)
static void multi_values_insert(struct record *recs, int recs_count)
struct m0_be_domain but_dom
static void recs_count(void)
struct m0_cas_hint cr_hint
static void fop_submit(struct m0_fop_type *ft, const struct m0_fid *index, struct m0_cas_rec *rec)
static void meta_cur_eot(void)
M0_INTERNAL bool m0_list_link_is_in(const struct m0_list_link *link)
static void m0_fi_enable_off_n_on_m(const char *func, const char *tag, uint32_t n, uint32_t m)
static void meta_lookup_none(void)
M0_INTERNAL void m0_dix_ldesc_fini(struct m0_dix_ldesc *ld)
struct m0_list_link * ll_next
M0_INTERNAL struct m0_fop_type cas_gc_fopt
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
#define m0_forall(var, nr,...)
M0_INTERNAL struct m0_fop_type cas_del_fopt
struct m0_be_domain_cfg but_dom_cfg
M0_INTERNAL void m0_reqh_start(struct m0_reqh *reqh)
static void lookup_all(struct m0_fid *index)
static void insert_lookup(void)
M0_INTERNAL uint64_t m0_rnd64(uint64_t *seed)
void(* cas__ut_cb_done)(struct m0_fom *fom)
static void index_op_rc(struct m0_fop_type *ft, struct m0_fid *index, uint64_t key, uint64_t val, uint64_t rc)
struct m0_list_link t_link
M0_INTERNAL void m0_fop_release(struct m0_ref *ref)
static void meta_fop_submit(struct m0_fop_type *fopt, struct meta_rec *meta_recs, int meta_recs_num)
M0_INTERNAL void m0_semaphore_fini(struct m0_semaphore *semaphore)
static void multi_values_lookup(struct record *recs, int recs_count)
static void meta_lookup_fail(void)
M0_INTERNAL int m0_cas_module_init(void)
static void fop_release(struct m0_ref *ref)
struct m0_ut_suite cas_service_ut
M0_INTERNAL void m0_rpc_at_fini(struct m0_rpc_at_buf *ab)
static void server_restart_nomkfs(void)
struct m0_rpc_at_buf cr_key
static void create_insert_drop_with_fail(bool inject_fail)
static void meta_cid_submit(struct m0_fop_type *fopt, struct m0_cas_id *cid)
void m0_be_ut_backend_fini(struct m0_be_ut_backend *ut_be)
static bool rec_check(const struct m0_cas_rec *rec, int rc, int key, int val)
M0_INTERNAL void m0_reqh_idle_wait_for(struct m0_reqh *reqh, struct m0_reqh_service *service)
M0_INTERNAL bool m0_ut_small_credits(void)
static void m0_fi_enable_once(const char *func, const char *tag)
static void multi_delete(void)
static void restart(void)
#define M0_XCODE_OBJ(type, ptr)
M0_INTERNAL struct m0_fop_type cas_put_fopt
static struct m0_fop_type * ft[]
static struct m0_cas_rec repv[N]
static void insert_2(void)
static void meta_cur_all(void)
M0_INTERNAL void m0_semaphore_down(struct m0_semaphore *semaphore)
static void service_stop(void)
M0_INTERNAL const struct m0_fid m0_cas_ctidx_fid
static struct m0_reqh_service * fdmi
M0_INTERNAL void m0_semaphore_up(struct m0_semaphore *semaphore)
static void reinit_nomkfs(void)
static struct m0_dtm_oper_descr reply
static void delete_2(void)
static void meta_delete_fail(void)
static void meta_lookup_2none(void)
#define M0_BUF_INIT(size, data)
struct m0_be_engine_cfg bc_engine
struct m0_pdclust_src_addr src
static struct m0_rpc_machine rpc_machine
static struct m0_fid ifid
struct m0_fid g_process_fid
static void lookup_N(void)
static struct m0_be_ut_backend be
void(* cas__ut_cb_fini)(struct m0_fom *fom)
static void cctg_create(void)
static struct flock_ut_fom fs[NR]
static void multi_lookup(void)
static void meta_fid_submit(struct m0_fop_type *fopt, struct m0_fid *fid)
static void _init(bool mkfs, bool use_small_credits)
static void create_insert_drop_fail()
static void meta_mt(void)