From df1b543398ba899419a27e7569f1bafe2f4ad7e3 Mon Sep 17 00:00:00 2001 From: Fan Yong Date: Mon, 9 Sep 2024 12:57:11 +0800 Subject: [PATCH] DAOS-16469 object: debug patch for EC16P2GX performance - b26 --- src/dtx/dtx_common.c | 4 ++-- src/dtx/dtx_rpc.c | 7 ++++--- src/object/cli_ec.c | 4 +++- src/object/srv_ec_aggregate.c | 24 +++++++++++++++++++++++- 4 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/dtx/dtx_common.c b/src/dtx/dtx_common.c index ff4f2dfe4ef0..97a7741bbeb5 100644 --- a/src/dtx/dtx_common.c +++ b/src/dtx/dtx_common.c @@ -755,7 +755,7 @@ dtx_batched_commit(void *arg) dbca->dbca_cleanup_done = 0; } - if (dtx_cont_opened(cont) && + if (0 && dtx_cont_opened(cont) && !dbca->dbca_deregister && dbca->dbca_cleanup_req == NULL && stat.dtx_oldest_active_time != 0 && dtx_sec2age(stat.dtx_oldest_active_time) >= dbca->dbca_cleanup_thd) { @@ -1351,7 +1351,7 @@ dtx_leader_end(struct dtx_leader_handle *dlh, struct ds_cont_hdl *coh, int resul } } - if (dth->dth_prepared || dtx_batched_ult_max == 0) { + if (dtx_batched_ult_max == 0) { dth->dth_sync = 1; goto sync; } diff --git a/src/dtx/dtx_rpc.c b/src/dtx/dtx_rpc.c index 1c0e73c9640f..2a9c71f4238a 100644 --- a/src/dtx/dtx_rpc.c +++ b/src/dtx/dtx_rpc.c @@ -225,9 +225,10 @@ dtx_req_cb(const struct crt_cb_info *cb_info) } out: - D_DEBUG(DB_TRACE, "DTX req for opc %x (req %p future %p) got reply from %d/%d: " - "epoch :"DF_X64", result %d\n", dra->dra_opc, req, dra->dra_future, - drr->drr_rank, drr->drr_tag, din != NULL ? din->di_epoch : 0, rc); + DL_CDEBUG(rc < 0 && rc != -DER_NONEXIST, DLOG_ERR, DB_TRACE, rc, + "DTX req for opc %x (req %p future %p) got reply from %d/%d: " + "epoch :"DF_X64"\n", dra->dra_opc, req, dra->dra_future, + drr->drr_rank, drr->drr_tag, din != NULL ? din->di_epoch : 0); drr->drr_comp = 1; drr->drr_result = rc; diff --git a/src/object/cli_ec.c b/src/object/cli_ec.c index bd5c7c1503bb..3d6d496df4b9 100644 --- a/src/object/cli_ec.c +++ b/src/object/cli_ec.c @@ -536,7 +536,9 @@ obj_ec_stripe_encode(daos_iod_t *iod, d_sg_list_t *sgl, uint32_t iov_idx, } } - ec_encode_data(cell_bytes, k, p, codec->ec_gftbls, data, parity_bufs); + (void)data; + (void)p; + //ec_encode_data(cell_bytes, k, p, codec->ec_gftbls, data, parity_bufs); out: for (i = 0; i < c_idx; i++) diff --git a/src/object/srv_ec_aggregate.c b/src/object/srv_ec_aggregate.c index 71c630fa947a..e03b84315ddd 100644 --- a/src/object/srv_ec_aggregate.c +++ b/src/object/srv_ec_aggregate.c @@ -2667,6 +2667,11 @@ cont_ec_aggregate_cb(struct ds_cont_child *cont, daos_epoch_range_t *epr, struct ec_agg_param *ec_agg_param = agg_param->ap_data; vos_iter_param_t iter_param = { 0 }; struct vos_iter_anchors anchors = { 0 }; + struct dtx_handle *dth = NULL; + struct dtx_share_peer *dsp; + struct dtx_id dti = { 0 }; + struct dtx_epoch epoch = { 0 }; + daos_unit_oid_t oid = { 0 }; int rc = 0; int blocks = 0; @@ -2715,8 +2720,25 @@ cont_ec_aggregate_cb(struct ds_cont_child *cont, daos_epoch_range_t *epr, agg_reset_entry(&ec_agg_param->ap_agg_entry, NULL, NULL); retry: + epoch.oe_value = epr->epr_hi; + rc = dtx_begin(cont->sc_hdl, &dti, &epoch, 0, cont->sc_pool->spc_map_version, &oid, + NULL, 0, 0, NULL, &dth); + if (rc != 0) + goto update_hae; + rc = vos_iterate(&iter_param, VOS_ITER_OBJ, true, &anchors, agg_iterate_pre_cb, - agg_iterate_post_cb, ec_agg_param, NULL); + agg_iterate_post_cb, ec_agg_param, dth); + if (rc == -DER_INPROGRESS && !d_list_empty(&dth->dth_share_tbd_list)) { + while ((dsp = d_list_pop_entry(&dth->dth_share_tbd_list, + struct dtx_share_peer, dsp_link)) != NULL) { + D_ERROR(DF_CONT ": EC aggregate hit non-committed DTX " DF_DTI "\n", + DP_CONT(cont->sc_pool->spc_uuid, cont->sc_uuid), + DP_DTI(&dsp->dsp_xid)); + dtx_dsp_free(dsp); + } + } + + dtx_end(dth, cont, rc); /* Post_cb may not being executed in some cases */ agg_clear_extents(&ec_agg_param->ap_agg_entry);