Skip to content
Draft
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
8 changes: 4 additions & 4 deletions src/vos/vos_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ vos_tx_begin(struct dtx_handle *dth, struct umem_instance *umm, bool is_sysdb,
/* CPU may yield when umem_tx_begin, related object maybe evicted during that. */
rc = umem_tx_begin(umm, vos_txd_get(is_sysdb));
if (rc == 0 && obj != NULL && unlikely(vos_obj_is_evicted(obj))) {
D_DEBUG(DB_IO, "Obj " DF_UOID " is evicted(1), need to restart TX.\n",
DP_UOID(obj->obj_id));
D_WARN("Obj " DF_UOID " is evicted(1), need to restart TX.\n",
DP_UOID(obj->obj_id));
rc = umem_tx_end(umm, -DER_TX_RESTART);
}

Expand All @@ -247,8 +247,8 @@ vos_tx_begin(struct dtx_handle *dth, struct umem_instance *umm, bool is_sysdb,
if (rc == 0) {
/* CPU may yield when umem_tx_begin, related object maybe evicted during that. */
if (obj != NULL && unlikely(vos_obj_is_evicted(obj))) {
D_DEBUG(DB_IO, "Obj " DF_UOID " is evicted(2), need to restart TX.\n",
DP_UOID(obj->obj_id));
D_WARN("Obj " DF_UOID " is evicted(2), need to restart TX.\n",
DP_UOID(obj->obj_id));

return umem_tx_end(umm, -DER_TX_RESTART);
}
Expand Down
15 changes: 12 additions & 3 deletions src/vos/vos_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2569,8 +2569,8 @@ vos_update_end(daos_handle_t ioh, uint32_t pm_ver, daos_key_t *dkey, int err,

D_ASSERT(ioc->ic_obj != NULL);
if (unlikely(vos_obj_is_evicted(ioc->ic_obj))) {
D_DEBUG(DB_IO, "Obj " DF_UOID " is evicted during update, need to restart TX.\n",
DP_UOID(ioc->ic_oid));
D_WARN("Obj " DF_UOID " is evicted during update, need to restart TX.\n",
DP_UOID(ioc->ic_oid));

D_GOTO(abort, err = -DER_TX_RESTART);
}
Expand Down Expand Up @@ -2611,8 +2611,11 @@ vos_update_end(daos_handle_t ioh, uint32_t pm_ver, daos_key_t *dkey, int err,

err = vos_obj_incarnate(ioc->ic_obj, &ioc->ic_epr, ioc->ic_bound, flags,
DAOS_INTENT_UPDATE, ioc->ic_ts_set);
if (err != 0)
if (err != 0) {
if (err == -DER_TX_RESTART && !dtx_is_valid_handle(dth))
D_ERROR("Update failed out here(1)\n");
goto abort;
}

if (dtx_is_valid_handle(dth))
minor_epc = dth->dth_op_seq;
Expand All @@ -2624,13 +2627,17 @@ vos_update_end(daos_handle_t ioh, uint32_t pm_ver, daos_key_t *dkey, int err,
if (err) {
VOS_TX_LOG_FAIL(err, "Failed to update tree index: "DF_RC"\n",
DP_RC(err));
if (err == -DER_TX_RESTART && !dtx_is_valid_handle(dth))
D_ERROR("Update failed out here(2)\n");
goto abort;
}

/** Now that we are past the existence checks, ensure there isn't a
* read conflict
*/
if (vos_ts_set_check_conflict(ioc->ic_ts_set, ioc->ic_epr.epr_hi)) {
if (!dtx_is_valid_handle(dth))
D_ERROR("Update failed out here(3)\n");
err = -DER_TX_RESTART;
goto abort;
}
Expand All @@ -2642,6 +2649,8 @@ vos_update_end(daos_handle_t ioh, uint32_t pm_ver, daos_key_t *dkey, int err,
err == -DER_INPROGRESS) {
if (vos_ts_wcheck(ioc->ic_ts_set, ioc->ic_epr.epr_hi,
ioc->ic_bound)) {
if (!dtx_is_valid_handle(dth))
D_ERROR("Update failed out here(4)\n");
err = -DER_TX_RESTART;
}
}
Expand Down
Loading