Skip to content

Commit

Permalink
DAOS-16982 csum: recalculate checksum on retrying
Browse files Browse the repository at this point in the history
This PR fixes retry logic by actually recalculating the checksum; also
it removes the code that incorrectly records nvme error.

Change-Id: Ib0287851fea4d125eecda48c5ccb3c73ed85b8f8
Signed-off-by: Jinshan Xiong <[email protected]>
  • Loading branch information
jxiong committed Jan 24, 2025
1 parent 8ddde42 commit 7f74db4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/object/cli_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -5140,6 +5140,11 @@ obj_csum_update(struct dc_object *obj, daos_obj_update_t *args, struct obj_auxi_
if (!obj_csum_dedup_candidate(&obj->cob_co->dc_props, args->iods, args->nr))
return 0;

if (obj_auxi->csum_retry) {
/* release old checksum result and prepare for new calculation */
daos_csummer_free_ic(obj->cob_co->dc_csummer, &obj_auxi->rw_args.iod_csums);
}

return dc_obj_csum_update(obj->cob_co->dc_csummer, obj->cob_co->dc_props,
obj->cob_md.omd_id, args->dkey, args->iods, args->sgls, args->nr,
obj_auxi->reasb_req.orr_singv_los, &obj_auxi->rw_args.dkey_csum,
Expand All @@ -5150,6 +5155,11 @@ static int
obj_csum_fetch(const struct dc_object *obj, daos_obj_fetch_t *args,
struct obj_auxi_args *obj_auxi)
{
if (obj_auxi->csum_retry) {
/* release old checksum result and prepare for new calculation */
daos_csummer_free_ic(obj->cob_co->dc_csummer, &obj_auxi->rw_args.iod_csums);
}

return dc_obj_csum_fetch(obj->cob_co->dc_csummer, args->dkey, args->iods, args->sgls,
args->nr, obj_auxi->reasb_req.orr_singv_los,
&obj_auxi->rw_args.dkey_csum, &obj_auxi->rw_args.iod_csums);
Expand Down
2 changes: 0 additions & 2 deletions src/object/srv_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -1373,8 +1373,6 @@ obj_local_rw_internal(crt_rpc_t *rpc, struct obj_io_context *ioc, daos_iod_t *io
D_ERROR(DF_C_UOID_DKEY"verify_keys error: "DF_RC"\n",
DP_C_UOID_DKEY(orw->orw_oid, &orw->orw_dkey),
DP_RC(rc));
if (rc == -DER_CSUM)
obj_log_csum_err();
return rc;
}

Expand Down

0 comments on commit 7f74db4

Please sign in to comment.