Skip to content
Closed
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
16 changes: 11 additions & 5 deletions src/vos/vos_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2567,8 +2567,11 @@ vos_update_end(daos_handle_t ioh, uint32_t pm_ver, daos_key_t *dkey, int err,
if (err != 0)
goto abort;

D_ASSERT(ioc->ic_obj != NULL);
if (unlikely(vos_obj_is_evicted(ioc->ic_obj))) {
if (ioc->ic_obj == NULL) {
err = vos_obj_acquire(ioc->ic_cont, ioc->ic_oid, true, &ioc->ic_obj);
if (err != 0)
goto abort;
} else 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));

Expand Down Expand Up @@ -2755,9 +2758,12 @@ vos_update_begin(daos_handle_t coh, daos_unit_oid_t oid, daos_epoch_t epoch,
goto error;
}

rc = vos_obj_acquire(ioc->ic_cont, ioc->ic_oid, true, &ioc->ic_obj);
if (rc != 0)
goto error;
/* Hold the object for the evictable md-on-ssd phase2 pool */
if (vos_pool_is_evictable(vos_cont2pool(ioc->ic_cont))) {
rc = vos_obj_acquire(ioc->ic_cont, ioc->ic_oid, true, &ioc->ic_obj);
if (rc != 0)
goto error;
}

rc = dkey_update_begin(ioc);
if (rc != 0) {
Expand Down
10 changes: 10 additions & 0 deletions src/vos/vos_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,16 @@ vos_obj_punch(daos_handle_t coh, daos_unit_oid_t oid, daos_epoch_t epoch,
if (rc != 0)
goto reset;

if (!(hold_flags & VOS_OBJ_CREATE) && (obj->obj_df == NULL)) {
rc = vos_ilog_ts_add(ts_set, NULL, &oid, sizeof(oid));
D_ASSERT(rc == 0);

rc = -DER_NONEXIST;
vos_obj_release(obj, 0, true);
obj = NULL;
goto reset;
}

rc = vos_tx_begin(dth, vos_cont2umm(cont), cont->vc_pool->vp_sysdb, obj);
if (rc != 0)
goto reset;
Expand Down
10 changes: 10 additions & 0 deletions src/vos/vos_obj_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,8 @@ vos_obj_incarnate(struct vos_object *obj, daos_epoch_range_t *epr, daos_epoch_t
if (rc == 0) {
obj->obj_sync_epoch = obj->obj_df->vo_sync;
} else if (rc == -DER_NONEXIST) {
if (!(flags & VOS_OBJ_CREATE))
return -DER_NONEXIST;
rc = vos_oi_alloc(cont, obj->obj_id, epr->epr_hi, &obj->obj_df, ts_set);
if (rc) {
DL_ERROR(rc, DF_CONT ": Failed to allocate OI " DF_UOID ".",
Expand All @@ -559,6 +561,14 @@ vos_obj_incarnate(struct vos_object *obj, daos_epoch_range_t *epr, daos_epoch_t
return rc;
}
} else if (likely(intent != DAOS_INTENT_MARK)) {
struct vos_obj_df *tmp_df = NULL;

/* XXX debug */
rc = vos_oi_find(cont, obj->obj_id, &tmp_df, NULL);
D_ASSERT(rc == 0);
D_ASSERT(tmp_df != NULL);
D_ASSERT(tmp_df == obj->obj_df);

vos_ilog_ts_ignore(vos_obj2umm(obj), &obj->obj_df->vo_ilog);
rc = vos_ilog_ts_add(ts_set, &obj->obj_df->vo_ilog, &obj->obj_id,
sizeof(obj->obj_id));
Expand Down
Loading