Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-14105 object: collectively punch object #13386

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/cart/crt_rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,25 @@ crt_req_set_endpoint(crt_rpc_t *req, crt_endpoint_t *tgt_ep)
return rc;
}

int
crt_req_get_endpoint(crt_rpc_t *req, crt_endpoint_t *tgt_ep)
{
struct crt_rpc_priv *rpc_priv;
int rc = 0;

if (req == NULL || tgt_ep == NULL) {
D_ERROR("invalid parameter (NULL req or tgt_ep).\n");
rc = -DER_INVAL;
} else {
rpc_priv = container_of(req, struct crt_rpc_priv, crp_pub);
tgt_ep->ep_tag = rpc_priv->crp_pub.cr_ep.ep_tag;
tgt_ep->ep_rank = rpc_priv->crp_pub.cr_ep.ep_rank;
tgt_ep->ep_grp = rpc_priv->crp_pub.cr_ep.ep_grp;
}

return rc;
}

int
crt_req_set_timeout(crt_rpc_t *req, uint32_t timeout_sec)
{
Expand Down
25 changes: 16 additions & 9 deletions src/container/srv_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -1621,6 +1621,8 @@ ds_cont_tgt_open(uuid_t pool_uuid, uuid_t cont_hdl_uuid,
uuid_t cont_uuid, uint64_t flags, uint64_t sec_capas,
uint32_t status_pm_ver)
{
int *exclude_tgts = NULL;
uint32_t exclude_tgt_nr = 0;
struct cont_tgt_open_arg arg = { 0 };
struct dss_coll_ops coll_ops = { 0 };
struct dss_coll_args coll_args = { 0 };
Expand Down Expand Up @@ -1657,18 +1659,22 @@ ds_cont_tgt_open(uuid_t pool_uuid, uuid_t cont_hdl_uuid,
coll_args.ca_func_args = &arg;

/* setting aggregator args */
rc = ds_pool_get_failed_tgt_idx(pool_uuid, &coll_args.ca_exclude_tgts,
&coll_args.ca_exclude_tgts_cnt);
if (rc) {
rc = ds_pool_get_failed_tgt_idx(pool_uuid, &exclude_tgts, &exclude_tgt_nr);
if (rc != 0) {
D_ERROR(DF_UUID "failed to get index : rc "DF_RC"\n",
DP_UUID(pool_uuid), DP_RC(rc));
return rc;
goto out;
}

rc = dss_thread_collective_reduce(&coll_ops, &coll_args, 0);
D_FREE(coll_args.ca_exclude_tgts);
if (exclude_tgts != NULL) {
rc = dss_build_coll_bitmap(exclude_tgts, exclude_tgt_nr, &coll_args.ca_tgt_bitmap,
&coll_args.ca_tgt_bitmap_sz);
if (rc != 0)
goto out;
}

if (rc != 0) {
rc = dss_thread_collective_reduce(&coll_ops, &coll_args, 0);
if (rc != 0)
/* Once it exclude the target from the pool, since the target
* might still in the cart group, so IV cont open might still
* come to this target, especially if cont open/close will be
Expand All @@ -1678,9 +1684,10 @@ ds_cont_tgt_open(uuid_t pool_uuid, uuid_t cont_hdl_uuid,
D_ERROR("open "DF_UUID"/"DF_UUID"/"DF_UUID":"DF_RC"\n",
DP_UUID(pool_uuid), DP_UUID(cont_uuid),
DP_UUID(cont_hdl_uuid), DP_RC(rc));
return rc;
}

out:
D_FREE(coll_args.ca_tgt_bitmap);
D_FREE(exclude_tgts);
return rc;
}

Expand Down
3 changes: 2 additions & 1 deletion src/dtx/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def scons():
# dtx
denv.Append(CPPDEFINES=['-DDAOS_PMEM_BUILD'])
dtx = denv.d_library('dtx',
['dtx_srv.c', 'dtx_rpc.c', 'dtx_resync.c', 'dtx_common.c', 'dtx_cos.c'],
['dtx_srv.c', 'dtx_rpc.c', 'dtx_resync.c', 'dtx_common.c', 'dtx_cos.c',
'dtx_coll.c'],
install_off="../..")
denv.Install('$PREFIX/lib64/daos_srv', dtx)

Expand Down
Loading
Loading