-
Notifications
You must be signed in to change notification settings - Fork 304
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-15829 object: fix potential DRAM leak when retry after DTX refresh #14394
Conversation
Two possible DRAM leak when re-enter obj_local_rw_internal(): 1. daos_iod_recx_dup() will allocate new iods to replace input one. But the input one may be former daos_iod_recx_dup() allocated. 2. obj_fetch_csum_init() may allocate new orw_iod_csums arrays that may overwrite former allocated ones. Some other fixes: a. obj_fetch_create_maps() may miss new iods wnen re-enter. b. obj_prep_fetch_sgls() miss to handle re-enter case. c. Drop redundant anthor restore for enumeration retry after DTX refresh. d. Add some log message for the cases that need DTX refresh. Signed-off-by: Fan Yong <fan.yong@intel.com>
Ticket title is 'soak: 1.5m+ of these messages are occurring while running soak stress "external ERR # [160411.961395] mercury->rpc: [error] /builddir/build/BUILD/mercury-2.3 # hg_core_recv_input_cb(): NA callback returned error (NA_TIMEOUT)"' |
@@ -1952,32 +1964,13 @@ obj_local_rw(crt_rpc_t *rpc, struct obj_io_context *ioc, struct dtx_handle *dth) | |||
uint8_t *skips = (uint8_t *)&local_skips; | |||
uint32_t nr = 0; | |||
int rc; | |||
int count = 0; | |||
|
|||
rc = obj_get_iods_offs(orw->orw_oid, &orw->orw_iod_array, &ioc->ioc_oca, | |||
orw->orw_dkey_hash, ioc->ioc_layout_ver, &iods, | |||
&offs, &skips, &csums, &csum_info, &nr); |
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.
just confirm why change to do the retry outside obj_local_rw_internal_wrap()?
previously retry inside this func so need not do obj_get_iods_offs() and free the mem for retry, is it with bug?
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.
Because obj_local_rw_internal() may internally allocate some DRAM. If we do not release them before retry, when re-entry obj_local_rw_internal(), it may cause related DRAM leak, such as the iods. It is not impossible to trace them one by one, but it is still possible to miss some corner cases. So here, we introduce obj_local_rw_internal_wrap() that will cleanup obj_local_rw_internal() before re-entry.
anchors[0] = anchors[1]; | ||
obj_restore_enum_args(rpc, enum_arg, &saved_arg); | ||
if (opc == DAOS_OBJ_RPC_ENUMERATE) | ||
fill_oid(oei->oei_oid, enum_arg); |
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.
could you please explain a little bit why above restore section is not needed any more? thx
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.
Because vos_iterate() takes anchor parameter, that is both input and output. When vos_iterate() returns for retry, it contains enough information to locate the position for next item. When retry after DTX refresh, it is better to resume from break point (that is the one triggered DTX refresh) instead of from the relative beginning with restore() method.
…sh (#14394) Two possible DRAM leak when re-enter obj_local_rw_internal(): 1. daos_iod_recx_dup() will allocate new iods to replace input one. But the input one may be former daos_iod_recx_dup() allocated. 2. obj_fetch_csum_init() may allocate new orw_iod_csums arrays that may overwrite former allocated ones. Some other fixes: a. obj_fetch_create_maps() may miss new iods wnen re-enter. b. obj_prep_fetch_sgls() miss to handle re-enter case. c. Drop redundant anthor restore for enumeration retry after DTX refresh. d. Add some log message for the cases that need DTX refresh. Signed-off-by: Fan Yong <fan.yong@intel.com>
…sh (#14394) Two possible DRAM leak when re-enter obj_local_rw_internal(): 1. daos_iod_recx_dup() will allocate new iods to replace input one. But the input one may be former daos_iod_recx_dup() allocated. 2. obj_fetch_csum_init() may allocate new orw_iod_csums arrays that may overwrite former allocated ones. Some other fixes: a. obj_fetch_create_maps() may miss new iods wnen re-enter. b. obj_prep_fetch_sgls() miss to handle re-enter case. c. Drop redundant anthor restore for enumeration retry after DTX refresh. d. Add some log message for the cases that need DTX refresh. Signed-off-by: Fan Yong <fan.yong@intel.com>
…sh (#14394) (#14432) Two possible DRAM leak when re-enter obj_local_rw_internal(): 1. daos_iod_recx_dup() will allocate new iods to replace input one. But the input one may be former daos_iod_recx_dup() allocated. 2. obj_fetch_csum_init() may allocate new orw_iod_csums arrays that may overwrite former allocated ones. Some other fixes: a. obj_fetch_create_maps() may miss new iods wnen re-enter. b. obj_prep_fetch_sgls() miss to handle re-enter case. c. Drop redundant anthor restore for enumeration retry after DTX refresh. d. Add some log message for the cases that need DTX refresh. Signed-off-by: Fan Yong <fan.yong@intel.com>
Two possible DRAM leak when re-enter obj_local_rw_internal():
daos_iod_recx_dup() will allocate new iods to replace input one. But the input one may be former daos_iod_recx_dup() allocated.
obj_fetch_csum_init() may allocate new orw_iod_csums arrays that will overwrite former allocated ones.
Some other fixes:
a. obj_fetch_create_maps() may miss new iods when re-enter.
b. obj_prep_fetch_sgls() miss to handle re-enter case.
c. Drop redundant anchor restore for enumeration retry after DTX refresh.
d. Add some log message for the cases that need DTX refresh.
Before requesting gatekeeper:
Features:
(orTest-tag*
) commit pragma was used or there is a reason documented that there are no appropriate tags for this PR.Gatekeeper: