-
Notifications
You must be signed in to change notification settings - Fork 306
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-16982 csum: recalculate checksum on retrying #15786
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/** | ||
* (C) Copyright 2016-2024 Intel Corporation. | ||
* (C) Copyright 2025 Google LLC | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause-Patent | ||
*/ | ||
|
@@ -4758,38 +4759,37 @@ obj_comp_cb(tse_task_t *task, void *data) | |
|
||
if (task->dt_result == -DER_CSUM || task->dt_result == -DER_TX_UNCERTAIN || | ||
task->dt_result == -DER_NVME_IO) { | ||
if (!obj_auxi->spec_shard && !obj_auxi->spec_group && | ||
!obj_auxi->no_retry && !obj_auxi->ec_wait_recov) { | ||
if (!obj_auxi->spec_shard && !obj_auxi->spec_group && !obj_auxi->no_retry && | ||
!obj_auxi->ec_wait_recov) { | ||
/* Retry fetch on alternative shard */ | ||
if (obj_auxi->opc == DAOS_OBJ_RPC_FETCH) { | ||
if (task->dt_result == -DER_CSUM) | ||
if ((obj_auxi->opc == DAOS_OBJ_RPC_FETCH || | ||
obj_auxi->opc == DAOS_OBJ_RPC_UPDATE) && | ||
task->dt_result == -DER_CSUM) { | ||
struct shard_rw_args *rw_arg = &obj_auxi->rw_args; | ||
|
||
/* Retry a few times on checksum error; something must | ||
* go terribly wrong if checksum happened for 10 times in a | ||
* row therefore we stop trying anyways even though there | ||
* may exist more replicas. */ | ||
if (rw_arg->csum_retry_cnt < MAX_CSUM_RETRY) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for fetch, it should be if (rw_arg->csum_retry_cnt < max(MAX_CSUM_RETRY, obj_get_replicas(obj)) ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah that's reasonable too. Actually I have realized this so I put a comment above. My argument is that if the checksum error has already happened 10 times probably we should just stop trying, because something must go terribly wrong. The current logic would be persistent to future change too. If the error is due to network checksum error, we should stop trying anyways if it happened 10 times, no matter how many replicas it has. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, did not notice your comments. |
||
obj_auxi->csum_retry = 1; | ||
else if (task->dt_result == -DER_TX_UNCERTAIN) | ||
rw_arg->csum_retry_cnt++; | ||
D_DEBUG(DB_IO, DF_OID " checksum error, retrying\n", | ||
DP_OID(obj->cob_md.omd_id)); | ||
} else { | ||
D_ERROR(DF_OID | ||
" too many retries on checksum error. " | ||
"Failing I/O\n", | ||
DP_OID(obj->cob_md.omd_id)); | ||
obj_auxi->io_retry = 0; | ||
} | ||
} | ||
|
||
if (obj_auxi->opc == DAOS_OBJ_RPC_FETCH) { | ||
if (task->dt_result == -DER_TX_UNCERTAIN) | ||
obj_auxi->tx_uncertain = 1; | ||
else | ||
obj_auxi->nvme_io_err = 1; | ||
} else { | ||
if (obj_auxi->opc == DAOS_OBJ_RPC_UPDATE && | ||
task->dt_result == -DER_CSUM) { | ||
struct shard_rw_args *rw_arg = &obj_auxi->rw_args; | ||
|
||
/** Retry a few times on checksum error on update */ | ||
if (rw_arg->csum_retry_cnt < MAX_CSUM_RETRY) { | ||
obj_auxi->csum_retry = 1; | ||
rw_arg->csum_retry_cnt++; | ||
D_DEBUG(DB_IO, DF_OID" checksum error on " | ||
"update, retrying\n", | ||
DP_OID(obj->cob_md.omd_id)); | ||
} else { | ||
D_ERROR(DF_OID" checksum error on update, " | ||
"too many retries. Failing I/O\n", | ||
DP_OID(obj->cob_md.omd_id)); | ||
obj_auxi->io_retry = 0; | ||
} | ||
} else if (task->dt_result != -DER_NVME_IO) { | ||
/* Don't retry update for UNCERTAIN errors */ | ||
obj_auxi->io_retry = 0; | ||
} | ||
} | ||
} else { | ||
obj_auxi->io_retry = 0; | ||
|
@@ -5140,6 +5140,12 @@ 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_ci(obj->cob_co->dc_csummer, &obj_auxi->rw_args.dkey_csum); | ||
daos_csummer_free_ic(obj->cob_co->dc_csummer, &obj_auxi->rw_args.iod_csums); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we probably want to do this after a couple of retries There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's really easy to add but I wonder if that is indeed necessary, because cksum error is a rare event by itself. How about revising it to:
would that work for you? |
||
} | ||
|
||
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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the case of the actual issue we saw, it was the dkey_csum that needs to be recalculated, is that happening here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes if I read the code correctly because we release the previous calculation above. |
||
|
@@ -5150,6 +5156,12 @@ 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_ci(obj->cob_co->dc_csummer, &obj_auxi->rw_args.dkey_csum); | ||
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); | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,6 +1,7 @@ | ||||
/** | ||||
* (C) Copyright 2016-2024 Intel Corporation. | ||||
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP | ||||
* (C) Copyright 2025 Google LLC | ||||
* | ||||
* SPDX-License-Identifier: BSD-2-Clause-Patent | ||||
*/ | ||||
|
@@ -1371,11 +1372,8 @@ obj_local_rw_internal(crt_rpc_t *rpc, struct obj_io_context *ioc, daos_iod_t *io | |||
orw->orw_dkey_csum, &orw->orw_iod_array, | ||||
&orw->orw_oid); | ||||
if (rc != 0) { | ||||
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) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line 4602 in 1ee84b9
|
||||
obj_log_csum_err(); | ||||
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)); | ||||
return rc; | ||||
} | ||||
|
||||
|
@@ -4598,12 +4596,8 @@ ds_cpd_handle_one(crt_rpc_t *rpc, struct daos_cpd_sub_head *dcsh, struct daos_cp | |||
rc = csum_verify_keys(ioc->ioc_coc->sc_csummer, | ||||
&dcsr->dcsr_dkey, dcu->dcu_dkey_csum, | ||||
&dcu->dcu_iod_array, &dcsr->dcsr_oid); | ||||
if (rc != 0) { | ||||
if (rc == -DER_CSUM) | ||||
obj_log_csum_err(); | ||||
|
||||
if (rc != 0) | ||||
goto out; | ||||
} | ||||
|
||||
if (iohs == NULL) { | ||||
D_ALLOC_ARRAY(iohs, dcde->dcde_write_cnt); | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we only want to retry for csum error on wire? but not for NVME fetch CSUM error? No?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's correct, but it would lead to a much large change, and we also want to get a confirmation from the DAOS community to make sure it's fine to move that forward.
Therefore, our strategy here is to land a quick fix while waiting for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, ok