29 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_DTM 47 #include "dtm/operation_xc.h" 113 .updtt_name =
"test update" 158 .hit_name =
"source histories",
198 .hit_name =
"target histories",
316 .sd_name =
"SM finish",
410 .rmc_ep_addr =
"0@lo:12345:34:10" 418 .
name =
"dtm test fop",
420 .
xt = m0_dtm_oper_descr_xc,
568 for (j = 0; j <
nr; ++j) {
626 result = m0_dbenv_init(&db, db_name, 0,
true);
628 result = m0_emap_init(&
emap, &db,
"nonce");
632 static void db_fini(
void)
639 static uint64_t
hi = 7;
641 static void ltx_init(
void)
649 static void ltx_fini(
unsigned nr)
656 for (
i = 0;
i <
nr; ++
i) {
670 static void ltx_test_1_N(
void)
685 static void ltx_test_N_N(
void)
736 {
"ltx-1-N", ltx_test_1_N },
737 {
"ltx-N-N", ltx_test_N_N },
745 #undef M0_TRACE_SUBSYSTEM
static const struct m0_dtm_op_ops test_op_ops
static const struct m0_dtm_history_type tgt_htype
#define M0_DTM_UPDATE_DATA(label, rule, ver, orig_ver)
static struct m0_mutex lock
const struct m0_rpc_item_type_ops m0_fop_default_item_type_ops
static const struct m0_fom_ops test_fom_ops
static int service_start(struct m0_reqh_service *service)
static struct m0_dtm_local_remote local
static struct m0_dtm_update_descr udescr[UPDATE_NR+TGT_DELTA]
static struct m0_uint128 dtm_id_src
M0_INTERNAL void m0_fom_wakeup(struct m0_fom *fom)
M0_INTERNAL int m0_reqh_service_start(struct m0_reqh_service *service)
static struct m0_dtm_update control_tgt[OPER_NR][TGT_DELTA]
static void test_fom_fini(struct m0_fom *fom)
static const struct m0_dtm_op_ops op_ops
struct m0_dtm_update_comm upd_comm
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
static struct m0_dtm_oper oper_src[OPER_NR]
M0_INTERNAL void m0_ut_rpc_mach_init_and_add(struct m0_ut_rpc_mach_ctx *ctx)
int(* rso_start)(struct m0_reqh_service *service)
struct m0_ut_suite dtm_transmit_ut
M0_INTERNAL const struct m0_dtm_history_type m0_dtm_ltx_htype
static const struct m0_dtm_history_type src_htype
int const char const void size_t int flags
M0_INTERNAL void m0_dtm_fini(struct m0_dtm *dtm)
M0_INTERNAL void m0_reqh_service_stop(struct m0_reqh_service *service)
struct m0_reqh_service_type test_stype
static struct m0_dtm dtm_tgt
static size_t locality(const struct m0_fom *fom)
static int test_fom_tick(struct m0_fom *fom)
#define M0_FOP_TYPE_INIT(ft,...)
static struct m0_uint128 dtm_id_tgt
M0_INTERNAL void m0_fop_init(struct m0_fop *fop, struct m0_fop_type *fopt, void *data, void(*fop_release)(struct m0_ref *))
struct m0_dtm_remote * h_rem
M0_INTERNAL void m0_reqh_service_prepare_to_stop(struct m0_reqh_service *service)
static struct m0_fop redo_fop[OPER_NR]
static struct m0_dtm_update control_src[OPER_NR][TGT_DELTA]
struct m0_rpc_machine rmc_rpc
struct m0_dtm_fol_remote re_fol
int(* fto_create)(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
M0_INTERNAL void m0_dtm_oper_init(struct m0_dtm_oper *oper, struct m0_dtm *dtm, struct m0_tl *uu)
static void service_stop(struct m0_reqh_service *service)
static void rpc_fop_fom_init(void)
struct m0_cob_domain_id rmc_cob_id
static struct m0_dtm_update_descr redo_udescr[OPER_NR][UPDATE_NR+TGT_DELTA]
M0_INTERNAL void m0_dtm_oper_prepared(const struct m0_dtm_oper *oper, const struct m0_dtm_remote *rem)
static void op_ready(struct m0_dtm_op *op)
void * m0_fop_data(const struct m0_fop *fop)
void m0_fop_type_fini(struct m0_fop_type *fopt)
static const struct m0_dtm_history_ops src_ops
M0_INTERNAL void m0_dtm_oper_done(const struct m0_dtm_oper *oper, const struct m0_dtm_remote *rem)
M0_INTERNAL int m0_dtm_oper_build(struct m0_dtm_oper *oper, struct m0_tl *uu, const struct m0_dtm_oper_descr *ode)
static void transmit_build(void)
static struct m0_fom redo_fom[OPER_NR]
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
static struct m0_xcode_type ** xt[]
M0_INTERNAL void dtm_lock(struct m0_dtm *dtm)
static struct m0_dtm_update update_tgt[OPER_NR][UPDATE_NR+TGT_DELTA]
static const struct m0_reqh_service_ops test_service_ops
static struct m0_semaphore seq
int m0_reqh_service_type_register(struct m0_reqh_service_type *rstype)
M0_INTERNAL void m0_dtm_history_fini(struct m0_dtm_history *history)
const struct m0_dtm_update_ops * upd_ops
struct m0_fom_type ft_fom_type
static void redo_test(void)
static void op_miser(struct m0_dtm_op *op)
M0_INTERNAL void m0_reqh_shutdown_wait(struct m0_reqh *reqh)
static const struct m0_uint128 * tgt_id(const struct m0_dtm_history *history)
static int test_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
static const struct m0_reqh_service_type_ops stype_ops
M0_INTERNAL void m0_dtm_update_link(struct m0_tl *list, struct m0_dtm_update *update, uint32_t nr)
struct m0_dtm_history ch_history
static int update_init(struct m0_dtm_history *history, uint8_t id, struct m0_dtm_update *update)
static struct m0_uint128 id_tgt[UPDATE_NR]
M0_INTERNAL void m0_dtm_history_type_register(struct m0_dtm *dtm, const struct m0_dtm_history_type *ht)
void m0_fom_init(struct m0_fom *fom, const struct m0_fom_type *fom_type, const struct m0_fom_ops *ops, struct m0_fop *fop, struct m0_fop *reply, struct m0_reqh *reqh)
M0_INTERNAL void up_print(const struct m0_dtm_up *up)
static const struct m0_reqh_service_ops rpc_ops
static const struct m0_dtm_history_type_ops tgt_htype_ops
static struct m0_dtm dtm_src
const struct m0_dtm_op_ops * op_ops
static int undo_redo(struct m0_dtm_update *updt)
static void service_fini(struct m0_reqh_service *service)
static const struct m0_fop_type_ops test_ftype_ops
#define M0_AMB(obj, ptr, field)
static const struct socktype stype[]
M0_INTERNAL void m0_dtm_oper_pack(struct m0_dtm_oper *oper, const struct m0_dtm_remote *rem, struct m0_dtm_oper_descr *ode)
void m0_fom_fini(struct m0_fom *fom)
static void transmit_test(void)
M0_INTERNAL void m0_reqh_service_fini(struct m0_reqh_service *service)
M0_INTERNAL void op_print(const struct m0_dtm_op *op)
static struct m0_dtm_history history_tgt[UPDATE_NR]
static struct m0_dtm_history history_src[UPDATE_NR]
static void test_persistent(struct m0_dtm_history *history)
M0_INTERNAL int m0_semaphore_init(struct m0_semaphore *semaphore, unsigned value)
static int service_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
static struct m0_dtm_oper_descr redo_ode[OPER_NR]
static struct m0_dtm_local_remote tgt
M0_INTERNAL int m0_reqh_service_allocate(struct m0_reqh_service **out, const struct m0_reqh_service_type *stype, struct m0_reqh_context *rctx)
const struct m0_sm_conf test_conf
M0_INTERNAL void m0_dtm_history_reset(struct m0_dtm_history *history, m0_dtm_ver_t since)
static const struct m0_dtm_history_ops tgt_ops
M0_INTERNAL void m0_reqh_service_init(struct m0_reqh_service *service, struct m0_reqh *reqh, const struct m0_fid *fid)
M0_INTERNAL void m0_fop_fini(struct m0_fop *fop)
static size_t test_fom_home_locality(const struct m0_fom *fom)
M0_INTERNAL void m0_dtm_history_type_deregister(struct m0_dtm *dtm, const struct m0_dtm_history_type *ht)
struct m0_dtm_controlh rfo_ch
void(* doo_ready)(struct m0_dtm_op *op)
static void rpc_fop_fom_fini(void)
M0_INTERNAL void m0_reqh_idle_wait(struct m0_reqh *reqh)
static struct m0_be_emap * emap
static const struct m0_dtm_update_ops test_ops
static void oper_populate(int i, unsigned nr)
static const struct m0_dtm_history_type_ops src_htype_ops
static void src_init(struct m0_dtm_remote *dtm, unsigned flags, int ctrl)
#define m0_forall(var, nr,...)
M0_INTERNAL void m0_dtm_init(struct m0_dtm *dtm, struct m0_uint128 *id)
static void noop(struct m0_dtm_op *op)
M0_INTERNAL const struct m0_dtm_history_type m0_dtm_fol_remote_htype
struct m0_fop_data f_data
M0_INTERNAL void m0_dtm_reply_unpack(struct m0_dtm_oper *oper, const struct m0_dtm_oper_descr *reply)
static struct m0_reqh_service * test_svc
M0_INTERNAL void m0_dtm_update_init(struct m0_dtm_update *update, struct m0_dtm_history *history, struct m0_dtm_oper *oper, const struct m0_dtm_update_data *data)
int(* rsto_service_allocate)(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
static void tgt_init(void)
static struct m0_dtm_update_descr udescr_reply[UPDATE_NR+TGT_DELTA]
static const struct m0_dtm_update_type test_utype
int(* hito_find)(struct m0_dtm *dtm, const struct m0_dtm_history_type *ht, const struct m0_uint128 *id, struct m0_dtm_history **out)
static int src_find(struct m0_dtm *dtm, const struct m0_dtm_history_type *ht, const struct m0_uint128 *id, struct m0_dtm_history **out)
static m0_dtm_ver_t last[UPDATE_NR]
M0_INTERNAL void m0_fop_release(struct m0_ref *ref)
const struct m0_dtm_history_type * hio_type
#define M0_ALLOC_PTR(ptr)
M0_INTERNAL void m0_semaphore_fini(struct m0_semaphore *semaphore)
static struct m0_fop_type test_fopt
static struct m0_ut_rpc_mach_ctx test_ctx
M0_INTERNAL void m0_ut_rpc_mach_fini(struct m0_ut_rpc_mach_ctx *ctx)
static struct m0_dtm_update update_src[OPER_NR][UPDATE_NR]
static struct m0_net_test_service svc
M0_INTERNAL void m0_dtm_oper_close(struct m0_dtm_oper *oper)
M0_INTERNAL void m0_dtm_update_list_fini(struct m0_tl *list)
M0_INTERNAL bool op_state(const struct m0_dtm_op *op, enum m0_dtm_state state)
M0_INTERNAL void dtm_unlock(struct m0_dtm *dtm)
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
static struct m0_uint128 id_src[UPDATE_NR]
static struct m0_fop * fop
static const struct m0_fom_type_ops test_fom_type_ops
#define IS_IN_ARRAY(idx, array)
static struct m0_dtm_oper oper_tgt[OPER_NR]
static const struct m0_uint128 * src_id(const struct m0_dtm_history *history)
M0_INTERNAL void m0_dtm_history_init(struct m0_dtm_history *history, struct m0_dtm *dtm)
static struct m0_dtm_oper_descr ode
M0_INTERNAL void m0_dtm_local_remote_fini(struct m0_dtm_local_remote *lre)
#define M0_UINT128(hi, lo)
M0_INTERNAL void hi_print(const struct m0_dtm_hi *hi)
void(* fo_fini)(struct m0_fom *fom)
M0_INTERNAL void m0_dtm_oper_fini(struct m0_dtm_oper *oper)
M0_INTERNAL void m0_dtm_update_list_init(struct m0_tl *list)
M0_INTERNAL void m0_semaphore_down(struct m0_semaphore *semaphore)
void m0_fom_phase_set(struct m0_fom *fom, int phase)
M0_INTERNAL void m0_dtm_local_remote_init(struct m0_dtm_local_remote *lre, struct m0_uint128 *id, struct m0_dtm *local, struct m0_reqh *reqh)
struct m0_dtm_remote lre_rem
M0_INTERNAL void m0_semaphore_up(struct m0_semaphore *semaphore)
static void op_late(struct m0_dtm_op *op)
struct m0_dtm_oper_updates od_updates
M0_INTERNAL void m0_dtm_ltx_add(struct m0_dtm_ltx *ltx, struct m0_dtm_oper *oper)
struct m0_rpc_machine * ri_rmachine
static struct m0_dtm_oper_descr reply
M0_INTERNAL void m0_dtm_ltx_close(struct m0_dtm_ltx *ltx)
static void tgt_fini(void)
struct m0_rpc_item f_item
void m0_reqh_service_type_unregister(struct m0_reqh_service_type *rstype)
static struct m0_sm_state_descr fom_phases[]
static struct m0_reqh_service * service[REQH_IN_UT_MAX]
M0_INTERNAL void m0_dtm_ltx_init(struct m0_dtm_ltx *ltx, struct m0_dtm *dtm, struct m0_be_domain *dom)
M0_INTERNAL void m0_dtm_ltx_open(struct m0_dtm_ltx *ltx)
static void src_fini(void)
static int tgt_find(struct m0_dtm *dtm, const struct m0_dtm_history_type *ht, const struct m0_uint128 *id, struct m0_dtm_history **out)
M0_INTERNAL void m0_dtm_reply_pack(const struct m0_dtm_oper *oper, const struct m0_dtm_oper_descr *request, struct m0_dtm_oper_descr *reply)
const struct m0_dtm_history_ops * h_ops
int(* updo_redo)(struct m0_dtm_update *updt)