-
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-16097 vos: assign persistent DTX entry in vos_dtx_prepared #14708
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 |
---|---|---|
|
@@ -1220,6 +1220,9 @@ dtx_refresh_internal(struct ds_cont_child *cont, int *check_count, d_list_t *che | |
/* Handle the entries whose leaders are on current server. */ | ||
d_list_for_each_entry_safe(dsp, tmp, &self, dsp_link) { | ||
struct dtx_entry dte; | ||
struct dtx_entry *pdte = &dte; | ||
struct dtx_cos_key dck; | ||
|
||
|
||
d_list_del(&dsp->dsp_link); | ||
|
||
|
@@ -1228,13 +1231,31 @@ dtx_refresh_internal(struct ds_cont_child *cont, int *check_count, d_list_t *che | |
dte.dte_refs = 1; | ||
dte.dte_mbs = dsp->dsp_mbs; | ||
|
||
if (for_io) { | ||
rc = vos_dtx_check(cont->sc_hdl, &dsp->dsp_xid, NULL, NULL, NULL, false); | ||
switch(rc) { | ||
case DTX_ST_COMMITTABLE: | ||
dck.oid = dsp->dsp_oid; | ||
dck.dkey_hash = dsp->dsp_dkey_hash; | ||
rc = dtx_commit(cont, &pdte, &dck, 1); | ||
if (rc < 0 && rc != -DER_NONEXIST && for_io) | ||
d_list_add_tail(&dsp->dsp_link, cmt_list); | ||
else | ||
dtx_dsp_free(dsp); | ||
continue; | ||
case DTX_ST_COMMITTED: | ||
case -DER_NONEXIST: /* Aborted */ | ||
dtx_dsp_free(dsp); | ||
continue; | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
Comment on lines
+1234
to
+1254
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 am not too familiar with this part of DAOS, but it seems to me this change is not explained in the commit message. Or is it? |
||
rc = dtx_status_handle_one(cont, &dte, dsp->dsp_oid, dsp->dsp_dkey_hash, | ||
dsp->dsp_epoch, NULL, NULL); | ||
switch (rc) { | ||
case DSHR_NEED_COMMIT: { | ||
struct dtx_entry *pdte = &dte; | ||
struct dtx_cos_key dck; | ||
|
||
dck.oid = dsp->dsp_oid; | ||
dck.dkey_hash = dsp->dsp_dkey_hash; | ||
rc = dtx_commit(cont, &pdte, &dck, 1); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5650,7 +5650,8 @@ ds_obj_coll_punch_handler(crt_rpc_t *rpc) | |
1 /* start, [0] is for current engine */, ocpi->ocpi_disp_width, | ||
&exec_arg.coll_cur); | ||
|
||
rc = dtx_leader_begin(ioc.ioc_vos_coh, &odm->odm_xid, &epoch, 1, version, | ||
rc = dtx_leader_begin(ioc.ioc_vos_coh, &odm->odm_xid, &epoch, | ||
dcts[0].dct_shards[dmi->dmi_tgt_id].dcs_nr, version, | ||
Comment on lines
+5653
to
+5654
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. Is this bit not referred to in the commit message? |
||
&ocpi->ocpi_oid, NULL /* dti_cos */, 0 /* dti_cos_cnt */, | ||
NULL /* tgts */, exec_arg.coll_cur.grp_nr /* tgt_cnt */, | ||
dtx_flags, odm->odm_mbs, dce, &dlh); | ||
|
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.
Nitpick:
&& for_io
seems redundant considering the whole block is under this condition.