Skip to content
Open
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
15 changes: 3 additions & 12 deletions src/mgmt/srv_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,7 @@ ds_mgmt_pool_target_update_state(uuid_t pool_uuid, d_rank_list_t *svc_ranks,
pool_comp_state_t state, size_t scm_size, size_t nvme_size,
size_t meta_size, bool skip_rf_check)
{
uint64_t deadline;
int rc;
int rc;

if (state == PO_COMP_ST_UP) {
/* When doing reintegration, need to make sure the pool is created and started on
Expand All @@ -382,16 +381,8 @@ ds_mgmt_pool_target_update_state(uuid_t pool_uuid, d_rank_list_t *svc_ranks,
}
}

deadline = mgmt_ps_call_deadline();

again:
rc = dsc_pool_svc_update_target_state(pool_uuid, svc_ranks, deadline, target_addrs, state,
skip_rf_check);
if (rc == -DER_AGAIN && state == PO_COMP_ST_UP && daos_getmtime_coarse() < deadline) {
D_WARN("Retry incremental reintegration for pool " DF_UUID " because of race\n",
DP_UUID(pool_uuid));
goto again;
}
rc = dsc_pool_svc_update_target_state(pool_uuid, svc_ranks, mgmt_ps_call_deadline(),
target_addrs, state, skip_rf_check);

return rc;
}
Expand Down
51 changes: 12 additions & 39 deletions src/object/srv_obj_migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1884,7 +1884,7 @@ migrate_punch(struct migrate_pool_tls *tls, struct migrate_one *mrone,

static int
migrate_get_cont_child(struct migrate_pool_tls *tls, uuid_t cont_uuid,
struct ds_cont_child **cont_p, bool create)
struct ds_cont_child **cont_p)
{
struct ds_cont_child *cont_child = NULL;
int rc;
Expand All @@ -1895,32 +1895,14 @@ migrate_get_cont_child(struct migrate_pool_tls *tls, uuid_t cont_uuid,
return 0;
}

/* For incremental reintegration, the container has already been (re)-created. */
if (create && !tls->mpt_reintegrating) {
/* Since the shard might be moved different location for any pool operation,
* so it may need create the container in all cases.
*/
rc = ds_cont_child_open_create(tls->mpt_pool_uuid, cont_uuid, false, &cont_child);
if (rc != 0) {
if (rc == -DER_CONT_DESTROYING)
D_DEBUG(DB_REBUILD,
DF_RB ": container " DF_UUID
"already destroyed or destroying\n",
DP_RB_MPT(tls), DP_UUID(cont_uuid));
D_ASSERT(cont_child == NULL);
return rc;
}
} else {
rc = ds_cont_child_lookup(tls->mpt_pool_uuid, cont_uuid, &cont_child);
if (rc != 0) {
if (rc == -DER_CONT_NONEXIST || rc == -DER_CONT_DESTROYING)
D_DEBUG(DB_REBUILD,
DF_RB ": container " DF_UUID
"already destroyed or destroying\n",
DP_RB_MPT(tls), DP_UUID(cont_uuid));
D_ASSERT(cont_child == NULL);
return rc;
}
rc = ds_cont_child_lookup(tls->mpt_pool_uuid, cont_uuid, &cont_child);
if (rc != 0) {
if (rc == -DER_CONT_NONEXIST || rc == -DER_CONT_DESTROYING)
D_DEBUG(DB_REBUILD,
DF_RB ": container " DF_UUID "already destroyed or destroying\n",
DP_RB_MPT(tls), DP_UUID(cont_uuid));
D_ASSERT(cont_child == NULL);
return rc;
}

*cont_p = cont_child;
Expand All @@ -1936,7 +1918,7 @@ migrate_dkey(struct migrate_pool_tls *tls, struct migrate_one *mrone,
int rc;

D_ASSERT(dss_get_module_info()->dmi_xs_id != 0);
rc = migrate_get_cont_child(tls, mrone->mo_cont_uuid, &cont, true);
rc = migrate_get_cont_child(tls, mrone->mo_cont_uuid, &cont);
if (rc || cont == NULL)
D_GOTO(out, rc);

Expand Down Expand Up @@ -2990,8 +2972,6 @@ migrate_enum_unpack_cb(struct dc_obj_enum_unpack_io *io, void *data)
}

if (!create_migrate_one) {
struct ds_cont_child *cont = NULL;

if (daos_is_dkey_uint64(io->ui_oid.id_pub) && io->ui_dkey.iov_len == 8)
D_DEBUG(DB_REBUILD,
DF_RB ": " DF_UOID "/int dkey: " DF_U64 " does not need rebuild.",
Expand All @@ -3001,13 +2981,6 @@ migrate_enum_unpack_cb(struct dc_obj_enum_unpack_io *io, void *data)
D_DEBUG(DB_REBUILD, DF_RB ": " DF_UOID "/" DF_KEY " does not need rebuild.",
DP_RB_MPT(tls), DP_UOID(io->ui_oid), DP_KEY(&io->ui_dkey));

/* Create the vos container when no record need to be rebuilt for this shard,
* for the case of reintegrate the container was discarded ahead.
*/
rc = migrate_get_cont_child(tls, arg->arg->cont_uuid, &cont, true);
if (cont != NULL)
ds_cont_child_put(cont);

D_GOTO(put, rc = 0);
}

Expand Down Expand Up @@ -3058,7 +3031,7 @@ migrate_obj_punch_one(void *data)
D_DEBUG(DB_REBUILD, DF_RB ": tls %p version %d punch " DF_U64 " " DF_UOID "\n",
DP_RB_MPT(tls), tls, arg->version, arg->punched_epoch, DP_UOID(arg->oid));

rc = migrate_get_cont_child(tls, arg->cont_uuid, &cont, true);
rc = migrate_get_cont_child(tls, arg->cont_uuid, &cont);
if (rc != 0 || cont == NULL)
D_GOTO(out, rc);

Expand Down Expand Up @@ -3525,7 +3498,7 @@ migrate_obj_ult(void *data)
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);
migrate_get_cont_child(tls, arg->cont_uuid, &cont_child);
if (cont_child != NULL && !cont_child->sc_stopping) {
if (vos_oi_exist(cont_child->sc_hdl, arg->oid)) {
stable_epoch = vos_cont_get_global_stable_epoch(cont_child->sc_hdl);
Expand Down
5 changes: 0 additions & 5 deletions src/pool/rpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,6 @@ enum pool_map_update_flags {
POOL_RESET_RECOV_CONT = (1 << 1),
};

enum pool_recov_cont_flags {
PRCF_BIND_BULK = (1 << 0),
};

static inline uint32_t
pool_opc_2map_opc(uint32_t pool_opc)
{
Expand Down Expand Up @@ -942,7 +938,6 @@ CRT_RPC_DECLARE(pool_eval_self_heal, DAOS_ISEQ_POOL_EVAL_SELF_HEAL, DAOS_OSEQ_PO
((uint32_t) (prci_flags) CRT_VAR) \
((uint32_t) (prci_padding) CRT_VAR) \
((uint64_t) (prci_cont_nr) CRT_VAR) \
((crt_bulk_t) (prci_cont_bulk) CRT_VAR) \
((struct pool_target_addr) (prci_addrs) CRT_ARRAY)

#define DAOS_OSEQ_POOL_RECOV_CONT /* output fields */ \
Expand Down
25 changes: 17 additions & 8 deletions src/pool/srv_cli.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* (C) Copyright 2017-2024 Intel Corporation.
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
* (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -960,12 +960,18 @@ pool_extend_init(uuid_t pool_uuid, crt_rpc_t *rpc, void *varg)
static int
pool_extend_consume(uuid_t pool_uuid, crt_rpc_t *rpc, void *varg)
{
struct pool_extend_arg *arg = varg;
struct pool_extend_out *out = crt_reply_get(rpc);
int rc = out->peo_op.po_rc;

if (rc != 0)
DL_ERROR(rc, DF_UUID ": Failed to set targets to UP state for reintegration",
DP_UUID(pool_uuid));
if (rc == -DER_AGAIN) {
D_DEBUG(DB_MGMT, DF_UUID ": extend to %d ranks: " DF_RC "\n", DP_UUID(pool_uuid),
arg->pea_ntargets, DP_RC(rc));
rc = DSC_POOL_SVC_CALL_AGAIN;
} else if (rc != 0) {
DL_ERROR(rc, DF_UUID ": failed to extend to %d ranks", DP_UUID(pool_uuid),
arg->pea_ntargets);
}
return rc;
}

Expand Down Expand Up @@ -1016,11 +1022,14 @@ pool_update_target_state_consume(uuid_t pool_uuid, crt_rpc_t *rpc, void *varg)
struct pool_tgt_update_out *out = crt_reply_get(rpc);
int rc = out->pto_op.po_rc;

if (rc != 0)
if (rc == -DER_AGAIN) {
D_DEBUG(DB_MGMT, DF_UUID ": set targets to state %s: " DF_RC "\n",
DP_UUID(pool_uuid), pool_map_status2name(arg->puta_state), DP_RC(rc));
rc = DSC_POOL_SVC_CALL_AGAIN;
} else if (rc != 0) {
DL_ERROR(rc, DF_UUID ": Failed to set targets to %s state", DP_UUID(pool_uuid),
arg->puta_state == PO_COMP_ST_DOWN ? "DOWN"
: arg->puta_state == PO_COMP_ST_UP ? "UP"
: "UNKNOWN");
pool_map_status2name(arg->puta_state));
}
return rc;
}

Expand Down
Loading
Loading