Skip to content
Draft
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
24 changes: 11 additions & 13 deletions src/object/srv_obj_migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ enum {
};
#define MIGRATE_DATA_MB_ENV "D_MIGRATE_DATA_MB"

static inline bool
migrate_cont_gone(int rc)
{
return rc == -DER_CONT_NONEXIST || rc == -DER_CONT_DESTROYING;
}

struct migr_res_manager;

/* resource consumed by migration */
Expand Down Expand Up @@ -3066,6 +3072,8 @@ migrate_obj_punch_one(void *data)
DL_ERROR(rc, DF_RB ": " DF_UOID " migrate punch failed", DP_RB_MPT(tls),
DP_UOID(arg->oid));

if (migrate_cont_gone(rc))
rc = 0;
if (tls->mpt_status == 0 && rc != 0)
tls->mpt_status = rc;

Expand Down Expand Up @@ -3591,23 +3599,13 @@ migrate_obj_ult(void *data)
if (arg->epoch == DAOS_EPOCH_MAX)
tls->mpt_obj_count++;

if (rc == -DER_CONT_NONEXIST || rc == -DER_CONT_DESTROYING) {
struct ds_cont_child *cont_child = NULL;

/* check again to see if the container is being destroyed. */
migrate_get_cont_child(tls, arg->cont_uuid, &cont_child, false);
if (cont_child == NULL || cont_child->sc_stopping)
rc = 0;

if (cont_child)
ds_cont_child_put(cont_child);
}

if (DAOS_FAIL_CHECK(DAOS_REBUILD_OBJ_FAIL) &&
tls->mpt_obj_count >= daos_fail_value_get())
rc = -DER_IO;

out:
if (migrate_cont_gone(rc))
rc = 0;
if (tls->mpt_status == 0 && rc < 0)
tls->mpt_status = rc;

Expand Down Expand Up @@ -3849,7 +3847,7 @@ migrate_cont_iter_cb(daos_handle_t ih, d_iov_t *key_iov,
rc = dss_ult_execute(cont_fetch_start_ult, &fetch_arg, NULL, NULL, DSS_XS_SYS, 0,
MIGRATE_STACK_SIZE);
if (rc) {
if (rc == -DER_CONT_NONEXIST) {
if (migrate_cont_gone(rc)) {
DL_INFO(rc, DF_RB ": " DF_CONT " skip orphan container", DP_RB_MPT(tls),
DP_CONT(tls->mpt_pool_uuid, cont_uuid));
D_GOTO(cont_done, rc = 0);
Expand Down
Loading