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-16175 container: fix a case for cont_iv_hdl_fetch #15395

Merged
merged 1 commit into from
Oct 28, 2024
Merged
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
14 changes: 14 additions & 0 deletions src/container/container_iv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,7 @@ cont_iv_hdl_fetch(uuid_t cont_hdl_uuid, uuid_t pool_uuid,
D_DEBUG(DB_TRACE, "Can not find "DF_UUID" hdl\n",
DP_UUID(cont_hdl_uuid));

invalidate_retry:
/* Fetch the capability from the leader. To avoid extra locks,
* all metadatas are maintained by xstream 0, so let's create
* an ULT on xstream 0 to let xstream 0 to handle capa fetch
Expand Down Expand Up @@ -1046,6 +1047,19 @@ cont_iv_hdl_fetch(uuid_t cont_hdl_uuid, uuid_t pool_uuid,
if (*cont_hdl == NULL) {
D_DEBUG(DB_TRACE, "Can not find "DF_UUID" hdl\n",
DP_UUID(cont_hdl_uuid));
/* In reintegrate with case that the IC_CONT_CAPA cache is valid locally
* but cont open handle invalid (not in dt_cont_hdl_hash). For this case
* invalidate local IV cache first and retry again, to avoid in-flight
* UPDATE's failure. (IV locally valid then the IV fetch will not trigger
* cont_iv_ent_update() callback).
*/
if (!invalidate_current) {
invalidate_current = true;
ABT_eventual_free(&eventual);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: use ABT_eventual_reset() here to avoid eventual creation on retry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, will change if this PR need refresh. Or by other PR later.

D_DEBUG(DB_TRACE, DF_UUID" invalidate_current and retry\n",
DP_UUID(cont_hdl_uuid));
goto invalidate_retry;
}
D_GOTO(out_eventual, rc = -DER_NONEXIST);
}

Expand Down
7 changes: 5 additions & 2 deletions src/object/cli_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -6310,7 +6310,9 @@ obj_ec_get_parity_or_alldata_shard(struct obj_auxi_args *obj_auxi, unsigned int
shard_idx = grp_start + i;
if (obj_shard_is_invalid(obj, shard_idx, DAOS_OBJ_RPC_ENUMERATE)) {
if (++fail_cnt > obj_ec_parity_tgt_nr(oca)) {
D_ERROR(DF_OID" reach max failure "DF_RC"\n",
D_ERROR(DF_CONT", obj "DF_OID" reach max failure "DF_RC"\n",
DP_CONT(obj->cob_pool->dp_pool,
obj->cob_co->dc_uuid),
DP_OID(obj->cob_md.omd_id), DP_RC(-DER_DATA_LOSS));
D_GOTO(out, shard = -DER_DATA_LOSS);
}
Expand Down Expand Up @@ -6457,7 +6459,8 @@ obj_list_shards_get(struct obj_auxi_args *obj_auxi, unsigned int map_ver,
}

if (rc < 0) {
D_ERROR(DF_OID" Can not find shard grp %d: "DF_RC"\n",
D_ERROR(DF_CONT", obj "DF_OID" Can not find shard grp %d: "DF_RC"\n",
DP_CONT(obj->cob_pool->dp_pool, obj->cob_co->dc_uuid),
DP_OID(obj->cob_md.omd_id), grp_idx, DP_RC(rc));
D_GOTO(out, rc);
}
Expand Down
Loading